Skip to content
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.

Commit

Permalink
update to latest stencilswiftkit and use enrich method from kit
Browse files Browse the repository at this point in the history
  • Loading branch information
djbe committed Feb 16, 2017
1 parent cef6c08 commit 498d415
Show file tree
Hide file tree
Showing 13 changed files with 417 additions and 249 deletions.
4 changes: 2 additions & 2 deletions Tests/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ CHECKOUT OPTIONS:
:commit: 99efba56e942270780a452e5dcdfa1a839839cf4
:git: https://github.com/kylef/Stencil
StencilSwiftKit:
:commit: 59efee95ce9514e45b2bc6f5b78d3bdffb273a78
:commit: cc3c4d9aed593c7026e8d18c7d7d75628039a330
:git: https://github.com/SwiftGen/StencilSwiftKit

SPEC CHECKSUMS:
Expand All @@ -30,4 +30,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: af694ce70d27109bd28ecfb95a4370560e111f3a

COCOAPODS: 1.2.0.beta.3
COCOAPODS: 1.2.0
4 changes: 2 additions & 2 deletions Tests/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

378 changes: 195 additions & 183 deletions Tests/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

40 changes: 34 additions & 6 deletions Tests/Pods/StencilSwiftKit/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Tests/Pods/StencilSwiftKit/Sources/CallNode.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions Tests/Pods/StencilSwiftKit/Sources/Context.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions Tests/Pods/StencilSwiftKit/Sources/Environment.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Tests/Pods/StencilSwiftKit/Sources/Filters.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 80 additions & 0 deletions Tests/Pods/StencilSwiftKit/Sources/Parameters.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Tests/Pods/StencilSwiftKit/Sources/SetNode.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 25 additions & 22 deletions Tests/TestSuites/StoryboardsiOSTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,39 @@
//

import XCTest
import StencilSwiftKit

class StoryboardsiOSTests: XCTestCase {
enum Contexts {
static let all = ["empty", "all", "customname"]
}

// generate variations to test target module matching
static let variations: VariationGenerator = { name, context in
guard name == "all" else { return [(context: context, suffix: "")] }

return [
(context: context, suffix: ""),
(context: enrich(context, env: ["PRODUCT_MODULE_NAME": "Test"]), suffix: ""),
(context: enrich(context, env: ["PRODUCT_MODULE_NAME": "CustomSegue"]), suffix: "-ignore-module"),
(context: enrich(context, param: ["module": "Test"]), suffix: ""),
(context: enrich(context, param: ["module": "CustomSegue"]), suffix: "-ignore-module")
]

do {
return [
(context: context,
suffix: ""),
(context: try StencilContext.enrich(context: context,
parameters: [],
environment: ["PRODUCT_MODULE_NAME": "Test"]),
suffix: ""),
(context: try StencilContext.enrich(context: context,
parameters: [],
environment: ["PRODUCT_MODULE_NAME": "CustomSegue"]),
suffix: "-ignore-module"),
(context: try StencilContext.enrich(context: context,
parameters: ["module=Test"]),
suffix: ""),
(context: try StencilContext.enrich(context: context,
parameters: ["module=CustomSegue"]),
suffix: "-ignore-module")
]
} catch {
fatalError("Unable to create context variations")
}
}

func testDefault() {
Expand Down Expand Up @@ -55,17 +71,4 @@ class StoryboardsiOSTests: XCTestCase {
directory: .storyboardsiOS,
contextVariations: StoryboardsiOSTests.variations)
}

private static func enrich(_ context: [String: Any], env: [String: Any]? = nil, param: [String: Any]? = nil) -> [String: Any] {
var result = context

if let env = env {
result["env"] = env
}
if let param = param {
result["param"] = param
}

return result
}
}
Loading

0 comments on commit 498d415

Please sign in to comment.