forked from Carthage/Carthage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Cartfile] Reject
git
or ssh
protocol as a github
origin as it …
…does not make sense
- Loading branch information
Showing
4 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
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
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,36 @@ | ||
import Foundation | ||
import Nimble | ||
import Quick | ||
|
||
import Tentacle | ||
@testable import CarthageKit | ||
|
||
class GitHubSpec: QuickSpec { | ||
override func spec() { | ||
describe("Repository.fromIdentifier") { | ||
it("should parse owner/name form") { | ||
let identifier = "ReactiveCocoa/ReactiveSwift" | ||
let result = Repository.fromIdentifier(identifier) | ||
expect(result.value?.0) == Server.dotCom | ||
expect(result.value?.1) == Repository(owner: "ReactiveCocoa", name: "ReactiveSwift") | ||
expect(result.error).to(beNil()) | ||
} | ||
|
||
it("should reject git protocol") { | ||
let identifier = "git://git@some_host/some_owner/some_repo.git" | ||
let expected = ScannableError(message: "invalid GitHub repository identifier \"\(identifier)\"") | ||
let result = Repository.fromIdentifier(identifier) | ||
expect(result.value).to(beNil()) | ||
expect(result.error) == expected | ||
} | ||
|
||
it("should reject ssh protocol") { | ||
let identifier = "ssh://git@some_host/some_owner/some_repo.git" | ||
let expected = ScannableError(message: "invalid GitHub repository identifier \"\(identifier)\"") | ||
let result = Repository.fromIdentifier(identifier) | ||
expect(result.value).to(beNil()) | ||
expect(result.error) == expected | ||
} | ||
} | ||
} | ||
} |