Add tests for PBXProductType booleans

This commit is contained in:
Keith Smiley 2017-10-17 10:09:22 -07:00
parent 5c90d6189c
commit 894f00428a
No known key found for this signature in database
GPG Key ID: 33BA60D44C7167F8
3 changed files with 30 additions and 0 deletions

View File

@ -5,4 +5,5 @@ XCTMain([
testCase(GeneratorTests.allTests),
testCase(SpecLoadingTests.allTests),
testCase(FixtureTests.allTests),
testCase(ProjectSpecTests.allTests),
])

View File

@ -0,0 +1,28 @@
import Spectre
import XcodeGenKit
import xcproj
import ProjectSpec
func projectSpecTests() {
describe("ProjectSpec") {
let framework = Target(name: "MyFramework", type: .framework, platform: .iOS,
settings: Settings(buildSettings: ["SETTING_2": "VALUE"]))
let staticLibrary = Target(name: "MyStaticLibrary", type: .staticLibrary, platform: .iOS,
settings: Settings(buildSettings: ["SETTING_2": "VALUE"]))
let dynamicLibrary = Target(name: "MyDynamicLibrary", type: .dynamicLibrary, platform: .iOS,
settings: Settings(buildSettings: ["SETTING_2": "VALUE"]))
$0.describe("Types") {
$0.it("is a framework when it has the right extension") {
try expect(framework.type.isFramework).to.beTrue()
}
$0.it("is a library when it has the right type") {
try expect(staticLibrary.type.isLibrary).to.beTrue()
try expect(dynamicLibrary.type.isLibrary).to.beTrue()
}
}
}
}

View File

@ -7,5 +7,6 @@ class XCodeGenKitTests: XCTestCase {
projectGeneratorTests()
specLoadingTests()
fixtureTests()
projectSpecTests()
}
}