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:
// Failed - Expected to equal 1, got an unexpected error thrown: ...
expect { try throwAnError() }.to(equal(1))
- objc: expectAction() is now a macro that requires an Objective-C block instead of building an implicit block:
// Old-style before RC 2
expectAction([obj raiseException]).to(raiseException(...));
// New-style in RC 2
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:
// failed - Just checking equality!
expect(1).to(equal(2), description: "Just checking equality!")
- swift: Fixed
≈
precedence - swift:
beAKindOf()
andbeAnInstanceOf()
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
throwError()
matcher for verifying the behavior of closures that throw an error:
expect { try somethingDangerous() }.to(throwError())
- 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