Skip to content

Commit

Permalink
Merge pull request #12 from shams-ahmed/master
Browse files Browse the repository at this point in the history
swift 3 support, fix Rx dependence issue, minor project changes to speed up tests
  • Loading branch information
ashfurrow committed Jan 24, 2017
2 parents 2fd9cc1 + a99f581 commit e8154fa
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 72 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
@@ -1,7 +1,7 @@
osx_image: xcode7.3
osx_image: xcode8.2
language: objective-c
podfile: Demo/Podfile
cache: cocoapods

before_install:
- gem install cocoapods -v '1.2.0.beta.1'
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

1 change: 1 addition & 0 deletions Demo/.swift-version
@@ -0,0 +1 @@
3.0
130 changes: 97 additions & 33 deletions Demo/Demo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0710"
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
12 changes: 6 additions & 6 deletions Demo/Demo/AppDelegate.swift
Expand Up @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

func applicationWillResignActive(application: UIApplication) {
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(application: UIApplication) {
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication) {
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(application: UIApplication) {
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(application: UIApplication) {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

Expand Down
2 changes: 1 addition & 1 deletion Demo/DemoTests/DemoTests.swift
Expand Up @@ -23,7 +23,7 @@ class RxNimbleTest: QuickSpec {

it("works with variables") {
let subject = Variable("Hi")

expect(subject) == "Hi"
}
}
Expand Down
34 changes: 18 additions & 16 deletions Demo/Podfile.lock
@@ -1,13 +1,13 @@
PODS:
- Nimble (4.0.1)
- Quick (0.9.2)
- RxBlocking (2.4):
- RxSwift (~> 2.4)
- RxNimble (0.1.0):
- Nimble (~> 4.0)
- RxBlocking (~> 2.0)
- RxSwift (~> 2.0)
- RxSwift (2.4)
- Nimble (5.1.1)
- 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)
- RxSwift (3.0.1)

DEPENDENCIES:
- Nimble
Expand All @@ -16,13 +16,15 @@ DEPENDENCIES:

EXTERNAL SOURCES:
RxNimble:
:path: "../"
:path: ../

SPEC CHECKSUMS:
Nimble: 0f3c8b8b084cda391209c3c5efbb48bedeeb920a
Quick: 18d057bc66451eedd5d1c8dc99ba2a5db6e60226
RxBlocking: 1226c1fa0ca1e0ca5f964d4330ca3649f2128680
RxNimble: 6fdc2efe09b9a305b152abd1a1d24a55bd370854
RxSwift: 67b9ef4e8b34fb394e200e754c6a09cc16559f94
Nimble: 415e3aa3267e7bc2c96b05fa814ddea7bb686a29
Quick: 8024e4a47e6cc03a9d5245ef0948264fc6d27cff
RxBlocking: 5de082d09d1ab45b49173f309f1a97d6b50f34c4
RxNimble: 26fc0ad74d0030a9123a5fe85ab47a2b50ec8616
RxSwift: af5680055c4ad04480189c52d28385b1029493a6

COCOAPODS: 0.39.0
PODFILE CHECKSUM: 7405369509db0cbd242146add66181ab5ab0efb0

COCOAPODS: 1.2.0.beta.1
8 changes: 4 additions & 4 deletions RxNimble.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "RxNimble"
s.version = "0.2.0"
s.version = "0.3.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.
Expand All @@ -14,9 +14,9 @@ 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", "~> 4.0"
s.dependency "RxSwift", "~> 2.0"
s.dependency "RxBlocking", "~> 2.0"
s.dependency "Nimble", "~> 5.1.1"
s.dependency "RxSwift", "~> 3.0.1"
s.dependency "RxBlocking", "~> 3.0.1"

s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO', 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"' }
end
16 changes: 8 additions & 8 deletions Source/RxNimble.swift
Expand Up @@ -32,9 +32,9 @@ public func equalFirst<T: Equatable, O: ObservableType where O.E == T?>(expected
let actualValue = try actualExpression.evaluate()?.toBlocking().first()

switch actualValue {
case .None:
case .none:
return expectedValue == nil
case .Some(let wrapped):
case .some(let wrapped):
return wrapped == expectedValue
}
}
Expand All @@ -47,27 +47,27 @@ public func equalFirst<T: Equatable>(expectedValue: T?) -> MatcherFunc<Variable<
let actualValue = try actualExpression.evaluate()?.value

switch actualValue {
case .None:
case .none:
return expectedValue == nil
case .Some(let wrapped):
case .some(let wrapped):
return wrapped == expectedValue
}
}
}

// Applies to Observables of T, which must conform to Equatable.
public func ==<T: Equatable, O: ObservableType where O.E == T>(lhs: Expectation<O>, rhs: T?) {
lhs.to( equalFirst(rhs) )
lhs.to(equalFirst(expectedValue: rhs))
}

public func ==<T: Equatable>(lhs: Expectation<Variable<T>>, rhs: T?) {
lhs.to( equalFirst(rhs) )
lhs.to(equalFirst(expectedValue: rhs))
}

public func ==<T: Equatable, O: ObservableType where O.E == Optional<T>>(lhs: Expectation<O>, rhs: T?) {
lhs.to( equalFirst(rhs) )
lhs.to(equalFirst(expectedValue: rhs))
}

public func ==<T: Equatable>(lhs: Expectation<Variable<T?>>, rhs: T?) {
lhs.to( equalFirst(rhs) )
lhs.to(equalFirst(expectedValue: rhs))
}

0 comments on commit e8154fa

Please sign in to comment.