Nimble extensions that making unit testing with RxSwift easier 🎉
RxSwift includes a really nifty little library called RxBlocking which provides convenience functions for peeking in on Observable
instances. Check is a blocking call, hence the name.
But writing code to check an Observable
's value is sooooo tedious:
let result = try! observable.toBlocking().first()
expect(result) == 42
With RxNimble
, we've added Nimble matchers for Observable
s, so the code above can be rewritten as:
expect(observable) == 42
Nice.
Add to your podfile:
pod 'RxNimble'
And pod install
and that's it!
Very very very rarely the Swift compiler gets confused about the different types and you need to use the original RxBlocking
code.
MIT ofc.