Add tests for legacy path behavior

This commit is contained in:
Ell Neal
2019-01-24 13:47:21 +00:00
parent 6589b840f6
commit 16a02fa1a6
3 changed files with 76 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
include:
path: legacy_paths_test/legacy_included_paths_test.yml
useRelativePaths: false
name: NewName
@@ -0,0 +1,33 @@
configFiles:
IncludedConfig: config
options:
carthageBuildPath: carthage_build
carthageExecutablePath: carthage_executable
targets:
IncludedTarget:
type: application
platform: tvOS
configFiles:
Config: config
sources:
- source
dependencies:
- framework: Framework
info:
path: info
entitlements:
path: entitlements
preBuildScripts:
- path: preBuildScript
postCompileScripts:
- path: postCompileScript
postBuildScripts:
- path: postBuildScript
aggregateTargets:
IncludedAggregateTarget:
targets:
- IncludedTarget
configFiles:
Config: config
buildScripts:
- path: buildScript
@@ -105,6 +105,45 @@ class SpecLoadingTests: XCTestCase {
]
}
$0.it("respects directory expansion preference") {
let path = fixturePath + "legacy_paths_test.yml"
let project = try Project(path: path)
try expect(project.configFiles) == [
"IncludedConfig": "config",
]
try expect(project.options) == SpecOptions(
carthageBuildPath: "carthage_build",
carthageExecutablePath: "carthage_executable"
)
try expect(project.aggregateTargets) == [
AggregateTarget(
name: "IncludedAggregateTarget",
targets: ["IncludedTarget"],
configFiles: ["Config": "config"],
buildScripts: [BuildScript(script: .path("buildScript"))]
),
]
try expect(project.targets) == [
Target(
name: "IncludedTarget",
type: .application,
platform: .tvOS,
configFiles: ["Config": "config"],
sources: ["source"],
dependencies: [Dependency(type: .framework, reference: "Framework")],
info: Plist(path: "info"),
entitlements: Plist(path: "entitlements"),
preBuildScripts: [BuildScript(script: .path("preBuildScript"))],
postCompileScripts: [BuildScript(script: .path("postCompileScript"))],
postBuildScripts: [BuildScript(script: .path("postBuildScript"))]
),
]
}
$0.it("parses yaml types") {
let path = fixturePath + "yaml.yml"
let dictionary = try loadYamlDictionary(path: path)