-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
341 additions
and
144 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// EndpointTests.swift | ||
// Tentacle | ||
// | ||
// Created by Romain Pouclet on 2017-02-05. | ||
// Copyright © 2017 Matt Diephouse. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
@testable import Tentacle | ||
|
||
class EndpointTests: XCTestCase { | ||
|
||
func testEndpointProvidesQueryItemsWhenNeeded() { | ||
let endpoint: Client.Endpoint = .content(owner: "palleas", repository: "romain-pouclet.com", path: "config.yml", ref: "sample-branch") | ||
XCTAssertEqual([URLQueryItem(name: "ref", value: "sample-branch")], endpoint.queryItems) | ||
|
||
let endpointWithoutRef: Client.Endpoint = .content(owner: "palleas", repository: "romain-pouclet.com", path: "config.yml", ref: nil) | ||
XCTAssertEqual(0, endpointWithoutRef.queryItems.count) | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
Tests/Fixtures/repos-Palleas-opensource-Sample-repository-contents-README.md.data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"encoding" : "base64", | ||
"download_url" : "https:\/\/raw.githubusercontent.com\/Palleas-opensource\/Sample-repository\/master\/README.md", | ||
"url" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/contents\/README.md?ref=master", | ||
"path" : "README.md", | ||
"size" : 19, | ||
"type" : "file", | ||
"git_url" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/git\/blobs\/28ec72028c4ae47de689964a23ebb223f10cfe80", | ||
"html_url" : "https:\/\/github.com\/Palleas-opensource\/Sample-repository\/blob\/master\/README.md", | ||
"_links" : { | ||
"git" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/git\/blobs\/28ec72028c4ae47de689964a23ebb223f10cfe80", | ||
"html" : "https:\/\/github.com\/Palleas-opensource\/Sample-repository\/blob\/master\/README.md", | ||
"self" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/contents\/README.md?ref=master" | ||
}, | ||
"sha" : "28ec72028c4ae47de689964a23ebb223f10cfe80", | ||
"name" : "README.md", | ||
"content" : "IyBTYW1wbGUtcmVwb3NpdG9yeQ==\n" | ||
} |
Binary file added
BIN
+2.1 KB
Tests/Fixtures/repos-Palleas-opensource-Sample-repository-contents-README.md.response
Binary file not shown.
17 changes: 17 additions & 0 deletions
17
Tests/Fixtures/repos-Palleas-opensource-Sample-repository-contents-Tools-say.data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"target" : "\/usr\/bin\/say", | ||
"git_url" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/git\/blobs\/1e3f1fd0bc1f65cf4701c217f4d1fd9a3cd50721", | ||
"_links" : { | ||
"git" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/git\/blobs\/1e3f1fd0bc1f65cf4701c217f4d1fd9a3cd50721", | ||
"html" : "https:\/\/github.com\/Palleas-opensource\/Sample-repository\/blob\/master\/Tools\/say", | ||
"self" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/contents\/Tools\/say?ref=master" | ||
}, | ||
"html_url" : "https:\/\/github.com\/Palleas-opensource\/Sample-repository\/blob\/master\/Tools\/say", | ||
"download_url" : "https:\/\/raw.githubusercontent.com\/Palleas-opensource\/Sample-repository\/master\/Tools\/say", | ||
"size" : 12, | ||
"sha" : "1e3f1fd0bc1f65cf4701c217f4d1fd9a3cd50721", | ||
"path" : "Tools\/say", | ||
"type" : "symlink", | ||
"name" : "say", | ||
"url" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/contents\/Tools\/say?ref=master" | ||
} |
Binary file added
BIN
+2.1 KB
Tests/Fixtures/repos-Palleas-opensource-Sample-repository-contents-Tools-say.response
Binary file not shown.
66 changes: 66 additions & 0 deletions
66
Tests/Fixtures/repos-Palleas-opensource-Sample-repository-contents-Tools.data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
[ | ||
{ | ||
"_links" : { | ||
"git" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/git\/trees\/5bfad2b3f8e483b6b173d8aaff19597e84626f15", | ||
"html" : "https:\/\/github.com\/Palleas-opensource\/Sample-repository\/tree\/master\/Tools\/Directory", | ||
"self" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/contents\/Tools\/Directory?ref=master" | ||
}, | ||
"git_url" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/git\/trees\/5bfad2b3f8e483b6b173d8aaff19597e84626f15", | ||
"html_url" : "https:\/\/github.com\/Palleas-opensource\/Sample-repository\/tree\/master\/Tools\/Directory", | ||
"download_url" : null, | ||
"size" : 0, | ||
"sha" : "5bfad2b3f8e483b6b173d8aaff19597e84626f15", | ||
"path" : "Tools\/Directory", | ||
"type" : "dir", | ||
"name" : "Directory", | ||
"url" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/contents\/Tools\/Directory?ref=master" | ||
}, | ||
{ | ||
"_links" : { | ||
"git" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/git\/blobs\/c3eb8708a0a5aaa4f685aab24ef6403fbfd28efc", | ||
"html" : "https:\/\/github.com\/Palleas-opensource\/Sample-repository\/blob\/master\/Tools\/README.markdown", | ||
"self" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/contents\/Tools\/README.markdown?ref=master" | ||
}, | ||
"git_url" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/git\/blobs\/c3eb8708a0a5aaa4f685aab24ef6403fbfd28efc", | ||
"html_url" : "https:\/\/github.com\/Palleas-opensource\/Sample-repository\/blob\/master\/Tools\/README.markdown", | ||
"download_url" : "https:\/\/raw.githubusercontent.com\/Palleas-opensource\/Sample-repository\/master\/Tools\/README.markdown", | ||
"size" : 18, | ||
"sha" : "c3eb8708a0a5aaa4f685aab24ef6403fbfd28efc", | ||
"path" : "Tools\/README.markdown", | ||
"type" : "file", | ||
"name" : "README.markdown", | ||
"url" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/contents\/Tools\/README.markdown?ref=master" | ||
}, | ||
{ | ||
"_links" : { | ||
"git" : "https:\/\/api.github.com\/repos\/mdiep\/Tentacle\/git\/trees\/7a84505a3c553fd8e2879cfa63753b0cd212feb8", | ||
"html" : "https:\/\/github.com\/mdiep\/Tentacle\/tree\/7a84505a3c553fd8e2879cfa63753b0cd212feb8", | ||
"self" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/contents\/Tools\/Tentacle?ref=master" | ||
}, | ||
"git_url" : "https:\/\/api.github.com\/repos\/mdiep\/Tentacle\/git\/trees\/7a84505a3c553fd8e2879cfa63753b0cd212feb8", | ||
"html_url" : "https:\/\/github.com\/mdiep\/Tentacle\/tree\/7a84505a3c553fd8e2879cfa63753b0cd212feb8", | ||
"download_url" : null, | ||
"size" : 0, | ||
"sha" : "7a84505a3c553fd8e2879cfa63753b0cd212feb8", | ||
"path" : "Tools\/Tentacle", | ||
"type" : "file", | ||
"name" : "Tentacle", | ||
"url" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/contents\/Tools\/Tentacle?ref=master" | ||
}, | ||
{ | ||
"_links" : { | ||
"git" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/git\/blobs\/1e3f1fd0bc1f65cf4701c217f4d1fd9a3cd50721", | ||
"html" : "https:\/\/github.com\/Palleas-opensource\/Sample-repository\/blob\/master\/Tools\/say", | ||
"self" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/contents\/Tools\/say?ref=master" | ||
}, | ||
"git_url" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/git\/blobs\/1e3f1fd0bc1f65cf4701c217f4d1fd9a3cd50721", | ||
"html_url" : "https:\/\/github.com\/Palleas-opensource\/Sample-repository\/blob\/master\/Tools\/say", | ||
"download_url" : "https:\/\/raw.githubusercontent.com\/Palleas-opensource\/Sample-repository\/master\/Tools\/say", | ||
"size" : 12, | ||
"sha" : "1e3f1fd0bc1f65cf4701c217f4d1fd9a3cd50721", | ||
"path" : "Tools\/say", | ||
"type" : "symlink", | ||
"name" : "say", | ||
"url" : "https:\/\/api.github.com\/repos\/Palleas-opensource\/Sample-repository\/contents\/Tools\/say?ref=master" | ||
} | ||
] |
Binary file added
BIN
+2.09 KB
Tests/Fixtures/repos-Palleas-opensource-Sample-repository-contents-Tools.response
Binary file not shown.
17 changes: 17 additions & 0 deletions
17
Tests/Fixtures/repos-mdiep-Tentacle-contents-Carthage-Checkouts-ReactiveSwift.data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"_links" : { | ||
"git" : "https:\/\/api.github.com\/repos\/ReactiveCocoa\/ReactiveSwift\/git\/trees\/7920f196fd5073f4c98e03fa40b4e4b72470b935", | ||
"html" : "https:\/\/github.com\/ReactiveCocoa\/ReactiveSwift\/tree\/7920f196fd5073f4c98e03fa40b4e4b72470b935", | ||
"self" : "https:\/\/api.github.com\/repos\/mdiep\/Tentacle\/contents\/Carthage\/Checkouts\/ReactiveSwift?ref=master" | ||
}, | ||
"git_url" : "https:\/\/api.github.com\/repos\/ReactiveCocoa\/ReactiveSwift\/git\/trees\/7920f196fd5073f4c98e03fa40b4e4b72470b935", | ||
"html_url" : "https:\/\/github.com\/ReactiveCocoa\/ReactiveSwift\/tree\/7920f196fd5073f4c98e03fa40b4e4b72470b935", | ||
"download_url" : null, | ||
"size" : 0, | ||
"submodule_git_url" : "https:\/\/github.com\/ReactiveCocoa\/ReactiveSwift.git", | ||
"sha" : "7920f196fd5073f4c98e03fa40b4e4b72470b935", | ||
"path" : "Carthage\/Checkouts\/ReactiveSwift", | ||
"type" : "submodule", | ||
"name" : "ReactiveSwift", | ||
"url" : "https:\/\/api.github.com\/repos\/mdiep\/Tentacle\/contents\/Carthage\/Checkouts\/ReactiveSwift?ref=master" | ||
} |
Binary file added
BIN
+2.1 KB
Tests/Fixtures/repos-mdiep-Tentacle-contents-Carthage-Checkouts-ReactiveSwift.response
Binary file not shown.