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.
Merge pull request Carthage#2106 from Carthage/add-tests-for-xcodever…
…sion Add tests for XcodeVersion
- Loading branch information
Showing
2 changed files
with
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import Foundation | ||
import Nimble | ||
import Quick | ||
|
||
@testable import XCDBLD | ||
|
||
class XcodeVersionSpec: QuickSpec { | ||
override func spec() { | ||
describe("\(XcodeVersion.self)") { | ||
describe("initializer") { | ||
it("should return nil for empty string") { | ||
expect(XcodeVersion(xcodebuildOutput: "")).to(beNil()) | ||
} | ||
|
||
it("should return nil for unexpected input") { | ||
expect(XcodeVersion(xcodebuildOutput: "Xcode 1.0")).to(beNil()) | ||
} | ||
|
||
it("should return a valid value for expected input") { | ||
let version1 = XcodeVersion(xcodebuildOutput: "Xcode 8.3.2\nBuild version 8E2002") | ||
expect(version1).notTo(beNil()) | ||
expect(version1?.version) == "8.3.2" | ||
expect(version1?.buildVersion) == "8E2002" | ||
|
||
let version2 = XcodeVersion(xcodebuildOutput: "Xcode 9.0\nBuild version 9M189t") | ||
expect(version2).notTo(beNil()) | ||
expect(version2?.version) == "9.0" | ||
expect(version2?.buildVersion) == "9M189t" | ||
} | ||
} | ||
} | ||
} | ||
} |
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