Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to swift 5.0 #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "jspahrsummers/xcconfigs" ~> 0.10
github "Quick/Quick" ~> 0.10
github "Quick/Nimble" ~> 5.0
github "Quick/Quick" ~> 2.1.0
github "Quick/Nimble" ~> 8.0.0
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "Quick/Nimble" "v5.0.0"
github "Quick/Quick" "v0.10.0"
github "Quick/Nimble" "v8.0.2"
github "Quick/Quick" "v2.1.0"
github "jspahrsummers/xcconfigs" "0.10"
2 changes: 1 addition & 1 deletion Carthage/Checkouts/Nimble
Submodule Nimble updated 167 files
2 changes: 1 addition & 1 deletion Carthage/Checkouts/Quick
Submodule Quick updated 135 files
28 changes: 20 additions & 8 deletions Dobby.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "trivago GmbH";
TargetAttributes = {
DC7F6AF71AD8291800CCBF6D = {
Expand All @@ -424,7 +424,7 @@
};
DC7F6B021AD8291800CCBF6D = {
CreatedOnToolsVersion = 6.3;
LastSwiftMigration = 0800;
LastSwiftMigration = 1020;
};
DC8452171ADBF5CC006AC5D4 = {
CreatedOnToolsVersion = 6.3;
Expand All @@ -441,6 +441,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = DC7F6AEE1AD8291800CCBF6D;
Expand Down Expand Up @@ -552,6 +553,11 @@
isa = XCBuildConfiguration;
baseConfigurationReference = DCDDA8ED1BED4A7600BB5228 /* Debug.xcconfig */;
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CURRENT_PROJECT_VERSION = 1;
ENABLE_TESTABILITY = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
Expand All @@ -568,11 +574,17 @@
isa = XCBuildConfiguration;
baseConfigurationReference = DCDDA8EF1BED4A7600BB5228 /* Release.xcconfig */;
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CURRENT_PROJECT_VERSION = 1;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.9;
PRODUCT_BUNDLE_IDENTIFIER = "com.trivago.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(PROJECT_NAME)";
SWIFT_COMPILATION_MODE = wholemodule;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -592,7 +604,7 @@
);
INFOPLIST_FILE = Dobby/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -609,7 +621,7 @@
);
INFOPLIST_FILE = Dobby/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -624,7 +636,7 @@
INFOPLIST_FILE = DobbyTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(PROJECT_NAME)Tests";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -639,7 +651,7 @@
INFOPLIST_FILE = DobbyTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(PROJECT_NAME)Tests";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -657,7 +669,7 @@
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = Dobby/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -675,7 +687,7 @@
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = Dobby/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
6 changes: 3 additions & 3 deletions Dobby.xcodeproj/xcshareddata/xcschemes/Dobby-iOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
Expand Down Expand Up @@ -68,8 +68,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand Down
6 changes: 3 additions & 3 deletions Dobby.xcodeproj/xcshareddata/xcschemes/Dobby-macOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
Expand Down Expand Up @@ -68,8 +68,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand Down
2 changes: 1 addition & 1 deletion Dobby/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.7.0</string>
<string>0.8.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
4 changes: 2 additions & 2 deletions Dobby/Matcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public func matches<Value>(_ matches: @escaping (Value) -> Bool) -> Matcher<Valu

public extension Matcher {
/// Initializes a new matcher that matches anything.
public init() {
init() {
self.init(description: "_") { _ in true }
}
}
Expand Down Expand Up @@ -65,7 +65,7 @@ public func some<M: MatcherConvertible>(_ matcher: M) -> Matcher<M.ValueType?> {

public extension Matcher where Value: Equatable {
/// Initializes a new matcher that matches the given value.
public init(value: Value) {
init(value: Value) {
self.init(description: "\(value)") { actualValue in
return value == actualValue
}
Expand Down
2 changes: 1 addition & 1 deletion Dobby/Stub.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public final class Stub<Interaction, ReturnValue> {
behaviors.append((identifier: identifier, behavior: behavior))

return Disposable { [weak self] in
let index = self?.behaviors.index { otherIdentifier, _ in
let index = self?.behaviors.firstIndex { otherIdentifier, _ in
return otherIdentifier == identifier
}

Expand Down
72 changes: 36 additions & 36 deletions DobbyTests/MatcherSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,57 +80,57 @@ class MatcherSpec: QuickSpec {
let matcher: Dobby.Matcher<(Int, Int)> = equals((0, 1))

it("succeeds if all actual values equal the expected values") {
expect(matcher.matches(0, 1)).to(beTrue())
expect(matcher.matches((0, 1))).to(beTrue())
}

it("fails if any actual value does not equal the expected value") {
expect(matcher.matches(1, 1)).to(beFalse())
expect(matcher.matches(0, 0)).to(beFalse())
expect(matcher.matches((1, 1))).to(beFalse())
expect(matcher.matches((0, 0))).to(beFalse())
}
}

context("a 3-tuple") {
let matcher: Dobby.Matcher<(Int, Int, Int)> = equals((0, 1, 2))

it("succeeds if all actual values equal the expected values") {
expect(matcher.matches(0, 1, 2)).to(beTrue())
expect(matcher.matches((0, 1, 2))).to(beTrue())
}

it("fails if any actual value does not equal the expected value") {
expect(matcher.matches(1, 1, 2)).to(beFalse())
expect(matcher.matches(0, 0, 2)).to(beFalse())
expect(matcher.matches(0, 1, 1)).to(beFalse())
expect(matcher.matches((1, 1, 2))).to(beFalse())
expect(matcher.matches((0, 0, 2))).to(beFalse())
expect(matcher.matches((0, 1, 1))).to(beFalse())
}
}

context("a 4-tuple") {
let matcher: Dobby.Matcher<(Int, Int, Int, Int)> = equals((0, 1, 2, 3))

it("succeeds if all actual values equal the expected values") {
expect(matcher.matches(0, 1, 2, 3)).to(beTrue())
expect(matcher.matches((0, 1, 2, 3))).to(beTrue())
}

it("fails if any actual value does not equal the expected value") {
expect(matcher.matches(1, 1, 2, 3)).to(beFalse())
expect(matcher.matches(0, 0, 2, 3)).to(beFalse())
expect(matcher.matches(0, 1, 1, 3)).to(beFalse())
expect(matcher.matches(0, 1, 2, 2)).to(beFalse())
expect(matcher.matches((1, 1, 2, 3))).to(beFalse())
expect(matcher.matches((0, 0, 2, 3))).to(beFalse())
expect(matcher.matches((0, 1, 1, 3))).to(beFalse())
expect(matcher.matches((0, 1, 2, 2))).to(beFalse())
}
}

context("a 5-tuple") {
let matcher: Dobby.Matcher<(Int, Int, Int, Int, Int)> = equals((0, 1, 2, 3, 4))

it("succeeds if all actual values equal the expected values") {
expect(matcher.matches(0, 1, 2, 3, 4)).to(beTrue())
expect(matcher.matches((0, 1, 2, 3, 4))).to(beTrue())
}

it("fails if any actual value does not equal the expected value") {
expect(matcher.matches(1, 1, 2, 3, 4)).to(beFalse())
expect(matcher.matches(0, 0, 2, 3, 4)).to(beFalse())
expect(matcher.matches(0, 1, 1, 3, 4)).to(beFalse())
expect(matcher.matches(0, 1, 2, 2, 4)).to(beFalse())
expect(matcher.matches(0, 1, 2, 3, 3)).to(beFalse())
expect(matcher.matches((1, 1, 2, 3, 4))).to(beFalse())
expect(matcher.matches((0, 0, 2, 3, 4))).to(beFalse())
expect(matcher.matches((0, 1, 1, 3, 4))).to(beFalse())
expect(matcher.matches((0, 1, 2, 2, 4))).to(beFalse())
expect(matcher.matches((0, 1, 2, 3, 3))).to(beFalse())
}
}

Expand Down Expand Up @@ -176,57 +176,57 @@ class MatcherSpec: QuickSpec {
let matcher: Dobby.Matcher<(Int, Int)> = matches((equals(0), equals(1)))

it("succeeds if all actual values equal the expected values") {
expect(matcher.matches(0, 1)).to(beTrue())
expect(matcher.matches((0, 1))).to(beTrue())
}

it("fails if any actual value does not equal the expected value") {
expect(matcher.matches(1, 1)).to(beFalse())
expect(matcher.matches(0, 0)).to(beFalse())
expect(matcher.matches((1, 1))).to(beFalse())
expect(matcher.matches((0, 0))).to(beFalse())
}
}

context("a 3-tuple of matchers") {
let matcher: Dobby.Matcher<(Int, Int, Int)> = matches((equals(0), equals(1), equals(2)))

it("succeeds if all actual values equal the expected values") {
expect(matcher.matches(0, 1, 2)).to(beTrue())
expect(matcher.matches((0, 1, 2))).to(beTrue())
}

it("fails if any actual value does not equal the expected value") {
expect(matcher.matches(1, 1, 2)).to(beFalse())
expect(matcher.matches(0, 0, 2)).to(beFalse())
expect(matcher.matches(0, 1, 1)).to(beFalse())
expect(matcher.matches((1, 1, 2))).to(beFalse())
expect(matcher.matches((0, 0, 2))).to(beFalse())
expect(matcher.matches((0, 1, 1))).to(beFalse())
}
}

context("a 4-tuple of matchers") {
let matcher: Dobby.Matcher<(Int, Int, Int, Int)> = matches((equals(0), equals(1), equals(2), equals(3)))

it("succeeds if all actual values equal the expected values") {
expect(matcher.matches(0, 1, 2, 3)).to(beTrue())
expect(matcher.matches((0, 1, 2, 3))).to(beTrue())
}

it("fails if any actual value does not equal the expected value") {
expect(matcher.matches(1, 1, 2, 3)).to(beFalse())
expect(matcher.matches(0, 0, 2, 3)).to(beFalse())
expect(matcher.matches(0, 1, 1, 3)).to(beFalse())
expect(matcher.matches(0, 1, 2, 2)).to(beFalse())
expect(matcher.matches((1, 1, 2, 3))).to(beFalse())
expect(matcher.matches((0, 0, 2, 3))).to(beFalse())
expect(matcher.matches((0, 1, 1, 3))).to(beFalse())
expect(matcher.matches((0, 1, 2, 2))).to(beFalse())
}
}

context("a 5-tuple of matchers") {
let matcher: Dobby.Matcher<(Int, Int, Int, Int, Int)> = matches((equals(0), equals(1), equals(2), equals(3), equals(4)))

it("succeeds if all actual values equal the expected values") {
expect(matcher.matches(0, 1, 2, 3, 4)).to(beTrue())
expect(matcher.matches((0, 1, 2, 3, 4))).to(beTrue())
}

it("fails if any actual value does not equal the expected value") {
expect(matcher.matches(1, 1, 2, 3, 4)).to(beFalse())
expect(matcher.matches(0, 0, 2, 3, 4)).to(beFalse())
expect(matcher.matches(0, 1, 1, 3, 4)).to(beFalse())
expect(matcher.matches(0, 1, 2, 2, 4)).to(beFalse())
expect(matcher.matches(0, 1, 2, 3, 3)).to(beFalse())
expect(matcher.matches((1, 1, 2, 3, 4))).to(beFalse())
expect(matcher.matches((0, 0, 2, 3, 4))).to(beFalse())
expect(matcher.matches((0, 1, 1, 3, 4))).to(beFalse())
expect(matcher.matches((0, 1, 2, 2, 4))).to(beFalse())
expect(matcher.matches((0, 1, 2, 3, 3))).to(beFalse())
}
}

Expand Down