Nimble v2.0.0
This release is compatible with Xcode 7.0 (Swift 2.0). If you're looking for the swift-2.0
branch, it is now the master
branch.
Breaking Changes from RCs
There's one breaking changes besides the upgrade to Swift 2.0 if you haven't be using the release candidates.
Weak Linking to XCTest
Nimble is now weakly linked to XCTest. If you're not explicitly linking to XCTest (either via import or explicitly linking frameworks), you must now do so or else XCTest may not be automatically linked into your project. The default behavior of test bundles will link XCTest correctly.
The README documents using Nimble without XCTest, if you choose to integrate Nimble to your own test runner or framework.
Changes from RCs
- Added tvOS support
- Added
haveCount
matcher which is a convenience to check for length. - Added
NSMapTable
support forbeEmpty
.haveCount
also supports
NSMapTable
. - Fix warning of missing reference to
$SDKROOT/Developer/Library/Frameworks
- waitUntil's done argument now accepts variadic arguments to allow passing
directly to completion blocks that requires other arguments.
Past Release Candidate Changes
For convenience, here's the list of changes between the release candidates to 1.x.x versions.
Backwards Incompatible Changes
- Backwards incompatible changes for Swift 2.0
- 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 throwError() }.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(...));
Changes in Release Candidates
beEmpty()
matcher is now defined specifically for StringbeCloseTo
now works withNSDate
without having to convert it- Cocoapod users can now run Nimble in devices
- objc: Added
fail()
andfailWithMessage()
functions - 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()
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