Skip to content

Commit

Permalink
Switch some let's to var's. (#189)
Browse files Browse the repository at this point in the history
* Switch some let's to var's.

* add xcodegen as a dependency
  • Loading branch information
mbrandonw authored Mar 14, 2019
1 parent fd07b85 commit 1fb2e65
Show file tree
Hide file tree
Showing 10 changed files with 637 additions and 547 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2
4.2.1
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
xcodeproj:
xcodegen && xed .
swift run xcodegen

test-linux:
docker build --tag snapshot-testing . \
Expand Down
91 changes: 90 additions & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
@@ -1,7 +1,96 @@
{
"object": {
"pins": [

{
"package": "AEXML",
"repositoryURL": "https://github.com/tadija/AEXML",
"state": {
"branch": null,
"revision": "54bb8ea6fb693dd3f92a89e5fcc19e199fdeedd0",
"version": "4.3.3"
}
},
{
"package": "JSONUtilities",
"repositoryURL": "https://github.com/yonaskolb/JSONUtilities.git",
"state": {
"branch": null,
"revision": "db238f4858ac2ac3fff228b5b71ce90488a6a9b3",
"version": "4.1.0"
}
},
{
"package": "PathKit",
"repositoryURL": "https://github.com/kylef/PathKit.git",
"state": {
"branch": null,
"revision": "e2f5be30e4c8f531c9c1e8765aa7b71c0a45d7a0",
"version": "0.9.2"
}
},
{
"package": "Rainbow",
"repositoryURL": "https://github.com/onevcat/Rainbow.git",
"state": {
"branch": null,
"revision": "797a68d0a642609424b08f11eb56974a54d5f6e2",
"version": "3.1.4"
}
},
{
"package": "Spectre",
"repositoryURL": "https://github.com/kylef/Spectre.git",
"state": {
"branch": null,
"revision": "f14ff47f45642aa5703900980b014c2e9394b6e5",
"version": "0.9.0"
}
},
{
"package": "SwiftCLI",
"repositoryURL": "https://github.com/jakeheis/SwiftCLI.git",
"state": {
"branch": null,
"revision": "5318c37d3cacc8780f50b87a8840a6774320ebdf",
"version": "5.2.2"
}
},
{
"package": "SwiftShell",
"repositoryURL": "https://github.com/kareman/SwiftShell",
"state": {
"branch": null,
"revision": "beebe43c986d89ea5359ac3adcb42dac94e5e08a",
"version": "4.1.2"
}
},
{
"package": "XcodeGen",
"repositoryURL": "https://github.com/yonaskolb/XcodeGen.git",
"state": {
"branch": null,
"revision": "b490851c737809ee3cb545ee8ea41742cfb5a84d",
"version": "2.2.0"
}
},
{
"package": "xcodeproj",
"repositoryURL": "https://github.com/tuist/xcodeproj.git",
"state": {
"branch": null,
"revision": "8e15cc74149ee946b7ae125685177915b4ff7317",
"version": "6.4.0"
}
},
{
"package": "Yams",
"repositoryURL": "https://github.com/jpsim/Yams.git",
"state": {
"branch": null,
"revision": "26ab35f50ea891e8edefcc9d975db2f6b67e1d68",
"version": "1.0.1"
}
}
]
},
"version": 1
Expand Down
1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ let package = Package(
targets: ["SnapshotTesting"]),
],
dependencies: [
.package(url: "https://github.com/yonaskolb/XcodeGen.git", from: "2.2.0"),
],
targets: [
.target(
Expand Down
1,048 changes: 524 additions & 524 deletions SnapshotTesting.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NT_E1FAA066576312BD4B5DB23882D1278B"
BlueprintIdentifier = "64F17F6842573B100D61132C44E859BF"
BuildableName = "SnapshotTesting.framework"
BlueprintName = "SnapshotTesting_iOS"
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
Expand All @@ -32,7 +32,7 @@
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NT_3F877242DE1996BA0322ABCB069FB3D9"
BlueprintIdentifier = "6C1340F5ED556C5C9B3AE6579E6A859C"
BuildableName = "SnapshotTestingTests.xctest"
BlueprintName = "SnapshotTestingTests_iOS"
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
Expand All @@ -42,7 +42,7 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NT_E1FAA066576312BD4B5DB23882D1278B"
BlueprintIdentifier = "64F17F6842573B100D61132C44E859BF"
BuildableName = "SnapshotTesting.framework"
BlueprintName = "SnapshotTesting_iOS"
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
Expand Down Expand Up @@ -73,7 +73,7 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NT_E1FAA066576312BD4B5DB23882D1278B"
BlueprintIdentifier = "64F17F6842573B100D61132C44E859BF"
BuildableName = "SnapshotTesting.framework"
BlueprintName = "SnapshotTesting_iOS"
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
Expand Down Expand Up @@ -101,7 +101,7 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NT_E1FAA066576312BD4B5DB23882D1278B"
BlueprintIdentifier = "64F17F6842573B100D61132C44E859BF"
BuildableName = "SnapshotTesting.framework"
BlueprintName = "SnapshotTesting_iOS"
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NT_EFB00F39C5351E0984C1B0E093A05904"
BlueprintIdentifier = "0E84A93796E47328AAE7C80F4B484472"
BuildableName = "SnapshotTesting.framework"
BlueprintName = "SnapshotTesting_macOS"
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
Expand All @@ -32,7 +32,7 @@
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NT_0640DAF50FBD76E0169F38B530ABB4E3"
BlueprintIdentifier = "4D351C54668E3B5721A83752A850D9DE"
BuildableName = "SnapshotTestingTests.xctest"
BlueprintName = "SnapshotTestingTests_macOS"
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
Expand All @@ -42,7 +42,7 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NT_EFB00F39C5351E0984C1B0E093A05904"
BlueprintIdentifier = "0E84A93796E47328AAE7C80F4B484472"
BuildableName = "SnapshotTesting.framework"
BlueprintName = "SnapshotTesting_macOS"
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
Expand Down Expand Up @@ -73,7 +73,7 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NT_EFB00F39C5351E0984C1B0E093A05904"
BlueprintIdentifier = "0E84A93796E47328AAE7C80F4B484472"
BuildableName = "SnapshotTesting.framework"
BlueprintName = "SnapshotTesting_macOS"
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
Expand Down Expand Up @@ -101,7 +101,7 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NT_EFB00F39C5351E0984C1B0E093A05904"
BlueprintIdentifier = "0E84A93796E47328AAE7C80F4B484472"
BuildableName = "SnapshotTesting.framework"
BlueprintName = "SnapshotTesting_macOS"
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NT_693A6A5632B0A32E6E52A4DDD822E69E"
BlueprintIdentifier = "CADC8264FEF9AEA34FCCD430697A1D65"
BuildableName = "SnapshotTesting.framework"
BlueprintName = "SnapshotTesting_tvOS"
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
Expand All @@ -32,7 +32,7 @@
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NT_F155FA762896640C78950B0027F9917D"
BlueprintIdentifier = "A6C32CCDA022766883A434A0E026CFA2"
BuildableName = "SnapshotTestingTests.xctest"
BlueprintName = "SnapshotTestingTests_tvOS"
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
Expand All @@ -42,7 +42,7 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NT_693A6A5632B0A32E6E52A4DDD822E69E"
BlueprintIdentifier = "CADC8264FEF9AEA34FCCD430697A1D65"
BuildableName = "SnapshotTesting.framework"
BlueprintName = "SnapshotTesting_tvOS"
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
Expand Down Expand Up @@ -73,7 +73,7 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NT_693A6A5632B0A32E6E52A4DDD822E69E"
BlueprintIdentifier = "CADC8264FEF9AEA34FCCD430697A1D65"
BuildableName = "SnapshotTesting.framework"
BlueprintName = "SnapshotTesting_tvOS"
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
Expand Down Expand Up @@ -101,7 +101,7 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NT_693A6A5632B0A32E6E52A4DDD822E69E"
BlueprintIdentifier = "CADC8264FEF9AEA34FCCD430697A1D65"
BuildableName = "SnapshotTesting.framework"
BlueprintName = "SnapshotTesting_tvOS"
ReferencedContainer = "container:SnapshotTesting.xcodeproj">
Expand Down
6 changes: 3 additions & 3 deletions Sources/SnapshotTesting/Diffing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import XCTest
/// The ability to compare `Value`s and convert them to and from `Data`.
public struct Diffing<Value> {
/// Converts a value _to_ data.
public let toData: (Value) -> Data
public var toData: (Value) -> Data

/// Produces a value _from_ data.
public let fromData: (Data) -> Value
public var fromData: (Data) -> Value

/// Compares two values. If the values do not match, returns a failure message and artifacts describing the failure.
public let diff: (Value, Value) -> (String, [XCTAttachment])?
public var diff: (Value, Value) -> (String, [XCTAttachment])?

/// Creates a new `Diffing` on `Value`.
///
Expand Down
4 changes: 2 additions & 2 deletions Sources/SnapshotTesting/Snapshotting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ public struct Snapshotting<Value, Format> {
public var pathExtension: String?

/// How the snapshot format is diffed and converted to and from data.
public let diffing: Diffing<Format>
public var diffing: Diffing<Format>

/// How a value is transformed into a diffable snapshot format.
public let snapshot: (Value) -> Async<Format>
public var snapshot: (Value) -> Async<Format>

/// Creates a snapshot strategy.
///
Expand Down

0 comments on commit 1fb2e65

Please sign in to comment.