================================
This release is compatible with Xcode 7 beta 4 (Swift 2.0).
Note to Carthage Users: You must explicitly give this version for Carthage to install.
github "Quick/Nimble" "v2.0.0-rc.2"
Backwards Incompatible Changes
------------------------------
- swift: Expectations now properly handle the new Swift error handling syntax.
This means expectations implicitly allow throws and will fail with a useful
error message if a closure throws one:
expect { try throwAnError() }.to(equal(1)) // Failed - Expected to equal 1, got an unexpected error thrown: ...
- objc: expectAction() is now a macro that requires an Objective-C block instead of building an implicit block:
Old:
expectAction([obj raiseException]).to(raiseException(...));
New:
expectAction(^{ [obj raiseException]; }).to(raiseException(...));
Additions
---------
- You can now specify custom error messages for expectations. This is useful
for large integration tests, where an expectation is usually a sanity check to
a larger operation:
expect(1).to(equal(2), description: "Just checking equality!") // failed - Just checking equality!
- swift: Fixed ≈ precedence
- swift: beAKindOf() and beAnInstanceOf() emits useful errors when trying to
compare against Swift Types. This is not allowed in Nimble because the Swift
compiler already enforces this.
- swift: Added throwAnError() matcher for verifying the behavior of closures that throw an error:
expect { try somethingDangerous() }.to(throwAnError())
- objc: NMBObjCMatcher initializers are now public
- objc: contain() matcher now accepts variadic arguments. Each value passed to contain() is expected to be in the container:
expect(@[@1, @2, @3]).to(contain(@1, @2)); // passes