Releases: Quick/Nimble
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
Nimble v2.0.0 Release Candidate 3
This release is compatible with Xcode 7 beta 6 (Swift 2.0).
Note to carthage Users: You must explicitly give this version for Carthage to install.
github "Quick/Nimble" "v2.0.0-rc.3"
Changes
- Updated for Xcode 7 beta 6
beCloseTo
now works withNSDate
without having to convert it- Cocoapod users can now run Nimble in physical devices
- objc: Added
fail()
andfailWithMessage()
functions
Also, Quick has been updated for Xcode 7 beta 6.
Nimble 2.0.0 Release Candidate 2
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
Nimble v1.0.0 Final
Final version release! From now on, Nimble will follow semantic versioning rules.
Remember that version 1.0.0 of Nimble tracks with the stable Swift (1.2) / Xcode (6).
If you're using Swift 2.0 / Xcode 7, please use 2.0.0-rc.1
instead.
Diff from Release Candidate 1 to Final
Changes:
- beAKindOf and beAnInstanceOf raise errors when used with swift native types instead of producing obscure compiler errors.
- Publicize NMBObjCMatcher constructors
- Updated README to use
@import Nimble;
instead of#import <Nimble/Nimble.h>
for Objective-C.
Diff in Release Candidate 1
Repeated from 1.0.0-RC1 release notes.
Changes:
- FailureMessage.stringValue is now a property. It can be assigned to override other values.
- beTruthy() and beFalsy() matchers now work for nil types and Swift
- raiseException() no longer accepts matchers. Use the closure form instead.
- AssertionHandler protocol recieves FailureMessage instead of a String.
- Expectation.verify() now uses FailureMessage instead of String.
- Renamed NMB_wait* builder functions to be more consistent with rest of Nimble.
- fail() with no args passes through line number and file information
- NMBObjCMatcher closure no long accepts source location directly. Use actualExpression.location instead.
- FullMatcherFunc no longer negates doesNotMatch() when invoking its given closure.
Removed:
- NMBWait class is now private.
- Removed BasicMatcherWrapper
- Removed NonNilBasicMatcherWrapper
- Removed NonNilMatcherWrapper, use NonNilMatcherFunc for the same behavior.
- Removed FullMatcherWrapper
Nimble v2.0.0 Release Candidate 1
Release Candidate for 2.0.0, which supports Xcode 7 and Swift 2.0. Please try it out and report any issues. If all is well, then this version may migrate to final 2.0.0.
Note to Carthage Users: You must explicitly give this version for Carthage to install.
github "Quick/Nimble" "v2.0.0-rc.1"
Changes:
- Backwards incompatible changes for Swift 2.0.
- beEmpty() matcher is now defined specifically for String--in Swift 1.2 a
definition for NSString was sufficient.
Nimble v1.0.0 Release Candidate 1
Release Candidate for 1.0.0. Please try it out and report any issues. If all is well, then this version may migrate to final 1.0.0.
Note to Carthage Users: You must explicitly give this version for Carthage to install.
github "Quick/Nimble" "v1.0.0-rc.1"
Changes:
FailureMessage.stringValue
is now a property. It can be assigned to override other values.beTruthy()
andbeFalsy()
matchers now work for nil types and SwiftraiseException()
no longer accepts matchers. Use the closure form instead.AssertionHandler
protocol receives FailureMessage instead of a String.Expectation.verify()
now uses FailureMessage instead of String.- Renamed
NMB_wait*
builder functions to be more consistent with rest of Nimble. fail()
with no args passes through line number and file informationNMBObjCMatcher
closure no long accepts source location directly. UseactualExpression.location
instead.FullMatcherFunc
no longer negatesdoesNotMatch()
when invoking its given closure.
Removed:
NMBWait
class is now private.- Removed
BasicMatcherWrapper
- Removed
NonNilBasicMatcherWrapper
- Removed
NonNilMatcherWrapper
, useNonNilMatcherFunc
for the same behavior. - Removed
FullMatcherWrapper
Nimble v0.4.2
Changes:
- Set the minimum deployment target to iOS 7.
Nimble v0.4.1
Nimble v0.4.0
This version includes backwards-incompatible changes to support Swift 1.2. The
previous behavior of lazy evaluation of the argument in expect(...) has been
removed since Swift 1.2 no longer supports this. Use expect { ... } if you want
the lazy closure behavior.
Using toEventually() will check that this explicit closure is used and will
explicitly fail if the closure is not provided to expect.
Along with fixes for Swift 1.2, there are a few new features:
- Added beEmpty matcher for Objective-C.
- raiseException matcher can compare an exception's userInfo
Nimble v0.3.0
Changes in this release:
-
Added
waitUntil
for Objective-C. AlsowaitUntilWithTimeout
can be used with a custom timeout value. They work similarly to the swift versions:waitUntil(^(void (^done)(void) { // do a lot of work... done(); });
-
Added approximate equality (
beCloseTo
matcher) can use the≈
operator. The operator can be easily typed with (option+x):expect(1.2) ≈ 1.2001
-
Added approximate equality can also be given a delta with the
±
operator (option + shift + =). This also works with the==
operator, but still behaves likebeCloseTo
:// equivalent expectations expect(1.2) == 1.3 ± 0.5 expect(1.2) ≈ 1.3 ± 0.5
-
Added Nimble to Cocoapods Trunk. You no longer need to specify the
:git
keyword argument in your podfile. The prereleased version of cocoapods is still required.