From fba37b9db736d083459c7bdba98403711edb84d0 Mon Sep 17 00:00:00 2001 From: Rafael da Silva Ferreira Date: Thu, 30 Mar 2017 06:59:13 -0300 Subject: [PATCH 1/6] Update to Nimble 6.1 To solve https://github.com/RxSwiftCommunity/RxNimble/issues/13 --- Demo/Podfile.lock | 18 +++++++++--------- RxNimble.podspec | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Demo/Podfile.lock b/Demo/Podfile.lock index 2e163e9..807abb4 100644 --- a/Demo/Podfile.lock +++ b/Demo/Podfile.lock @@ -1,12 +1,12 @@ PODS: - - Nimble (5.1.1) + - Nimble (6.1.0) - Quick (1.0.0) - RxBlocking (3.0.1): - RxSwift (~> 3.0) - - RxNimble (0.3.0): - - Nimble (~> 5.1.1) - - RxBlocking (~> 3.0.1) - - RxSwift (~> 3.0.1) + - RxNimble (1.0.0): + - Nimble (~> 6.1) + - RxBlocking (~> 3.0) + - RxSwift (~> 3.0) - RxSwift (3.0.1) DEPENDENCIES: @@ -16,15 +16,15 @@ DEPENDENCIES: EXTERNAL SOURCES: RxNimble: - :path: ../ + :path: "../" SPEC CHECKSUMS: - Nimble: 415e3aa3267e7bc2c96b05fa814ddea7bb686a29 + Nimble: c53e6903fee94041b90ded74f135820437d8bf59 Quick: 8024e4a47e6cc03a9d5245ef0948264fc6d27cff RxBlocking: 5de082d09d1ab45b49173f309f1a97d6b50f34c4 - RxNimble: 26fc0ad74d0030a9123a5fe85ab47a2b50ec8616 + RxNimble: 2a00c336a1eb3cef24e66a7113c07e7a461b630b RxSwift: af5680055c4ad04480189c52d28385b1029493a6 PODFILE CHECKSUM: 7405369509db0cbd242146add66181ab5ab0efb0 -COCOAPODS: 1.2.0.beta.1 +COCOAPODS: 1.2.0 diff --git a/RxNimble.podspec b/RxNimble.podspec index bdf1c8d..b06e42e 100644 --- a/RxNimble.podspec +++ b/RxNimble.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "RxNimble" - s.version = "1.0.0" + s.version = "1.0.1" s.summary = "Nimble extensions that making unit testing with RxSwift easier 🎉" s.description = <<-DESC This library includes functions that make testing RxSwift projects easier with Nimble. @@ -14,7 +14,7 @@ Pod::Spec.new do |s| s.tvos.deployment_target = "9.0" s.source = { :git => "https://github.com/ashfurrow/RxNimble.git", :tag => s.version } s.source_files = "Source/**/*.swift" - s.dependency "Nimble", "~> 5.1" + s.dependency "Nimble", "~> 6.1" s.dependency "RxSwift", "~> 3.0" s.dependency "RxBlocking", "~> 3.0" From 98dfe2057424a225db823639529c001df21c1a19 Mon Sep 17 00:00:00 2001 From: Rafael da Silva Ferreira Date: Tue, 4 Apr 2017 22:52:04 -0300 Subject: [PATCH 2/6] Increase Nimble compatibility To Nimble 6.0+. --- RxNimble.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RxNimble.podspec b/RxNimble.podspec index b06e42e..1509b86 100644 --- a/RxNimble.podspec +++ b/RxNimble.podspec @@ -14,7 +14,7 @@ Pod::Spec.new do |s| s.tvos.deployment_target = "9.0" s.source = { :git => "https://github.com/ashfurrow/RxNimble.git", :tag => s.version } s.source_files = "Source/**/*.swift" - s.dependency "Nimble", "~> 6.1" + s.dependency "Nimble", "~> 6.0" s.dependency "RxSwift", "~> 3.0" s.dependency "RxBlocking", "~> 3.0" From 91c6de96d87ed5f84dff586e684374d34ffb4343 Mon Sep 17 00:00:00 2001 From: Rafael da Silva Ferreira Date: Thu, 20 Apr 2017 17:25:45 -0300 Subject: [PATCH 3/6] Add CocoaPods repo update Based at https://github.com/RxSwiftCommunity/RxNimble/pull/14#issuecomment-295776668. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 1652f9c..f83534e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,4 +4,5 @@ podfile: Demo/Podfile cache: cocoapods before_install: - gem install cocoapods -v '1.2.0.beta.1' + - pod repo update script: cd Demo ; set -o pipefail && xcodebuild -workspace 'Demo.xcworkspace' -scheme 'Demo' -configuration 'Debug' -sdk iphonesimulator -destination platform='iOS Simulator',OS='9.1',name='iPhone 6s' build test | xcpretty -c --test From 59bb147c7a4fff650a97d932e741cee3ca1040ad Mon Sep 17 00:00:00 2001 From: Valerii Hiora Date: Tue, 25 Apr 2017 11:40:52 +0300 Subject: [PATCH 4/6] Fixed errors & warnings, changed `equalFirst` 1. It seems that nowadays Swift compiler can't deduce the right type while going through `ObservableType`, as a temporary workaround I've added implementation `==` for `Observable` and `Observablle` which should cover most cases. 2. `equalFirst` signature was simplified a bit to be more consistent with other `Nimble` matchers. That might be a bit more verbose `expect(something).to(equalFirst(expectedValue))` than `expect(something) == expectedValue` but it also is more explicit. That is API breaking change, so major version bumped, although it should be easily fixed by search/replace. --- Demo/Demo.xcodeproj/project.pbxproj | 4 ++-- Demo/Podfile.lock | 10 ++++---- RxNimble.podspec | 2 +- Source/RxNimble.swift | 36 ++++++++++++++++++----------- 4 files changed, 30 insertions(+), 22 deletions(-) diff --git a/Demo/Demo.xcodeproj/project.pbxproj b/Demo/Demo.xcodeproj/project.pbxproj index f94dfca..4ee21c5 100644 --- a/Demo/Demo.xcodeproj/project.pbxproj +++ b/Demo/Demo.xcodeproj/project.pbxproj @@ -259,7 +259,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; 8EC133641E3963166AA7C9C3 /* [CP] Embed Pods Frameworks */ = { @@ -319,7 +319,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/Demo/Podfile.lock b/Demo/Podfile.lock index 807abb4..5b9c840 100644 --- a/Demo/Podfile.lock +++ b/Demo/Podfile.lock @@ -3,8 +3,8 @@ PODS: - Quick (1.0.0) - RxBlocking (3.0.1): - RxSwift (~> 3.0) - - RxNimble (1.0.0): - - Nimble (~> 6.1) + - RxNimble (1.0.1): + - Nimble (~> 6.0) - RxBlocking (~> 3.0) - RxSwift (~> 3.0) - RxSwift (3.0.1) @@ -16,15 +16,15 @@ DEPENDENCIES: EXTERNAL SOURCES: RxNimble: - :path: "../" + :path: ../ SPEC CHECKSUMS: Nimble: c53e6903fee94041b90ded74f135820437d8bf59 Quick: 8024e4a47e6cc03a9d5245ef0948264fc6d27cff RxBlocking: 5de082d09d1ab45b49173f309f1a97d6b50f34c4 - RxNimble: 2a00c336a1eb3cef24e66a7113c07e7a461b630b + RxNimble: 81aaff8ada82ebf1dc861493ef2f507cf2f57fb8 RxSwift: af5680055c4ad04480189c52d28385b1029493a6 PODFILE CHECKSUM: 7405369509db0cbd242146add66181ab5ab0efb0 -COCOAPODS: 1.2.0 +COCOAPODS: 1.2.1 diff --git a/RxNimble.podspec b/RxNimble.podspec index 1509b86..cdb8e81 100644 --- a/RxNimble.podspec +++ b/RxNimble.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "RxNimble" - s.version = "1.0.1" + s.version = "2.0.0" s.summary = "Nimble extensions that making unit testing with RxSwift easier 🎉" s.description = <<-DESC This library includes functions that make testing RxSwift projects easier with Nimble. diff --git a/Source/RxNimble.swift b/Source/RxNimble.swift index ce2cbfc..cc23b00 100644 --- a/Source/RxNimble.swift +++ b/Source/RxNimble.swift @@ -3,10 +3,10 @@ import RxBlocking import Nimble // This is handy so we can write expect(o) == 1 instead of expect(o.value) == 1 or whatever. -public func equalFirst(expectedValue: T?) -> MatcherFunc { +public func equalFirst(_ expectedValue: T?) -> MatcherFunc where O.E == T { return MatcherFunc { actualExpression, failureMessage in - failureMessage.postfixMessage = "equal <\(expectedValue)>" + failureMessage.postfixMessage = "equal <\(String(describing: expectedValue))>" let actualValue = try actualExpression.evaluate()?.toBlocking().first() let matches = actualValue == expectedValue @@ -14,10 +14,10 @@ public func equalFirst(expectedV } } -public func equalFirst(expectedValue: T?) -> MatcherFunc> { +public func equalFirst(_ expectedValue: T?) -> MatcherFunc> { return MatcherFunc { actualExpression, failureMessage in - failureMessage.postfixMessage = "equal <\(expectedValue)>" + failureMessage.postfixMessage = "equal <\(String(describing: expectedValue))>" let actualValue = try actualExpression.evaluate()?.value let matches = actualValue == expectedValue && expectedValue != nil @@ -25,10 +25,10 @@ public func equalFirst(expectedValue: T?) -> MatcherFunc(expectedValue: T?) -> MatcherFunc { +public func equalFirst(_ expectedValue: T?) -> MatcherFunc where O.E == T? { return MatcherFunc { actualExpression, failureMessage in - failureMessage.postfixMessage = "equal <\(expectedValue)>" + failureMessage.postfixMessage = "equal <\(String(describing: expectedValue))>" let actualValue = try actualExpression.evaluate()?.toBlocking().first() switch actualValue { @@ -40,10 +40,10 @@ public func equalFirst(expected } } -public func equalFirst(expectedValue: T?) -> MatcherFunc> { +public func equalFirst(_ expectedValue: T?) -> MatcherFunc> { return MatcherFunc { actualExpression, failureMessage in - failureMessage.postfixMessage = "equal <\(expectedValue)>" + failureMessage.postfixMessage = "equal <\(String(describing: expectedValue))>" let actualValue = try actualExpression.evaluate()?.value switch actualValue { @@ -56,18 +56,26 @@ public func equalFirst(expectedValue: T?) -> MatcherFunc(lhs: Expectation, rhs: T?) { - lhs.to(equalFirst(expectedValue: rhs)) +public func ==(lhs: Expectation, rhs: T?) where O.E == T { + lhs.to(equalFirst(rhs)) } public func ==(lhs: Expectation>, rhs: T?) { - lhs.to(equalFirst(expectedValue: rhs)) + lhs.to(equalFirst(rhs)) } -public func ==>(lhs: Expectation, rhs: T?) { - lhs.to(equalFirst(expectedValue: rhs)) +public func ==(lhs: Expectation, rhs: T?) where O.E == Optional { + lhs.to(equalFirst(rhs)) } public func ==(lhs: Expectation>, rhs: T?) { - lhs.to(equalFirst(expectedValue: rhs)) + lhs.to(equalFirst(rhs)) +} + +public func ==>(lhs: Expectation, rhs: T?) { + lhs.to(equalFirst(rhs)) +} + +public func ==>>(lhs: Expectation, rhs: T?) { + lhs.to(equalFirst(rhs)) } From 237f599a1a766879e8b74bedfa4ea9966908cba5 Mon Sep 17 00:00:00 2001 From: Valerii Hiora Date: Tue, 25 Apr 2017 11:57:37 +0300 Subject: [PATCH 5/6] Forgot to update lock file after bumping version --- Demo/Podfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Demo/Podfile.lock b/Demo/Podfile.lock index 5b9c840..5d3092f 100644 --- a/Demo/Podfile.lock +++ b/Demo/Podfile.lock @@ -3,7 +3,7 @@ PODS: - Quick (1.0.0) - RxBlocking (3.0.1): - RxSwift (~> 3.0) - - RxNimble (1.0.1): + - RxNimble (2.0.0): - Nimble (~> 6.0) - RxBlocking (~> 3.0) - RxSwift (~> 3.0) @@ -22,7 +22,7 @@ SPEC CHECKSUMS: Nimble: c53e6903fee94041b90ded74f135820437d8bf59 Quick: 8024e4a47e6cc03a9d5245ef0948264fc6d27cff RxBlocking: 5de082d09d1ab45b49173f309f1a97d6b50f34c4 - RxNimble: 81aaff8ada82ebf1dc861493ef2f507cf2f57fb8 + RxNimble: 50a9da5852b298b2ec632cb00b79fa20be9f31b8 RxSwift: af5680055c4ad04480189c52d28385b1029493a6 PODFILE CHECKSUM: 7405369509db0cbd242146add66181ab5ab0efb0 From 9a24a3fd87933a5b7c52c361bb092c99d540827f Mon Sep 17 00:00:00 2001 From: Valerii Hiora Date: Tue, 25 Apr 2017 12:06:37 +0300 Subject: [PATCH 6/6] Ok, while we here, let's also update cocoapods to latest release and test against Xcode 8.3 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f83534e..481d430 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ -osx_image: xcode8.2 +osx_image: xcode8.3 language: objective-c podfile: Demo/Podfile cache: cocoapods before_install: - - gem install cocoapods -v '1.2.0.beta.1' + - gem install cocoapods -v '1.2.1' - pod repo update -script: cd Demo ; set -o pipefail && xcodebuild -workspace 'Demo.xcworkspace' -scheme 'Demo' -configuration 'Debug' -sdk iphonesimulator -destination platform='iOS Simulator',OS='9.1',name='iPhone 6s' build test | xcpretty -c --test +script: cd Demo ; set -o pipefail && xcodebuild -workspace 'Demo.xcworkspace' -scheme 'Demo' -configuration 'Debug' -sdk iphonesimulator -destination platform='iOS Simulator',OS='10.3',name='iPhone 6s' build test | xcpretty -c --test