Skip to content

Tags: martnst/Nimble

Tags

v4.1.0

Toggle v4.1.0's commit message

Verified

This tag was signed with the committer’s verified signature.
ashfurrow Ash Furrow
Added:

- `NSDate` is now supported when using the `beCloseTo` & `beCloseWithin` matchers (Quick#295 - thanks @mishimay!).
- `Expectation`'s `expression` property is now public, for use when creating custom matchers (Quick#300 - thanks @akashivskyy!).

Improved:

- The `contain` matcher now accepts sequences, in addition to the existing variadic form (Quick#297 - thanks @stigi!).
- The documentation for `beIdenticalTo` has been improved (Quick#299 - thanks @lukeredpath!).

Fixed:

- Bitcode is now disabled for the tvOS platform (Quick#287 - thanks @phatblat!).
- Nimble can now be compiled under Xcode 8 with Swift 2.3 (Quick#302). Swift 3 support will be part of a future release.

v4.0.1

Toggle v4.0.1's commit message

Verified

This tag was signed with the committer’s verified signature.
ashfurrow Ash Furrow
- Fixes a race condition in Xcode 7.3 that would prevent Nimble from …

…writing output to the Xcode console during a test run. See [Quick#273](Quick#273).

- Fixes a problem with CocoaPods integration concerning header files that can't be found. See [Quick#280](Quick#280).

v4.0.0

Toggle v4.0.0's commit message

Verified

This tag was signed with the committer’s verified signature.
jeffh Jeff Hui
Nimble v4.0.0

================

Breaking Changes
----------------

- Remove `FullMatcherFunc`. Use `Matcher` or `MatcherFunc` instead. More
  breaking changes around the protocols will occur in the future.

Features
--------

- `BeEmpty()` supports `NSIndexSet`
- Expose `stringify()` which Nimble matchers use to convert values to string.
  - You can add custom support to stringify by conforming your type to
    `TestDebugStringConvertible`

Bug Fixes
----------

- Fix bug where exceptions weren't properly caught for cocoapods users
- Resolve warnings for Xcode 7.3

v3.2.0

Toggle v3.2.0's commit message
Nimble v3.2.0

=============

This release includes bug fixes, minor enhancements, and a couple of new matchers. This release targets Xcode 7.2.x and Swift 2.1. It also generally works with Xcode 7.3 betas and Swift 2.2 (thanks @NachoSoto!), although many deprecation warnings are emitted.

Additionally, initial support is available for using Nimble with the Swift Package Manager on both OS X and Linux. This should be considered a technical preview as SwiftPM and the do not yet have any stable releases.

New Matcher: postNotifications
==============================
This matcher allows testing that an expression causes one or more `NSNotification`s to be posted to a notification center. Thanks to @bgerstle for this work!

```swift
expect {
    NSNotificationCenter.defaultCenter().postNotification(myNotification)
}.to(postNotifications(equal([myNotification]))
```

New Matcher: beVoid
===================
This matcher allows testing whether an optional value of type `Void?` contains a value, or is `nil`. Thanks to @inamiy for this!

```swift
expect(() as ()?).to(beVoid())
```

Asynchronous Expectation Defaults
=================================
It is now possible to modify the global default values for the timeout and poll interval used by `toEventually`. Thanks @mjbeauregard!

```swift
AsyncDefaults.Timeout = 2
AsyncDefaults.PollInterval = 0.05
```

Swift Package Manager
=====================
It is now possible to reference Nimble as a package dependency in a `Package.swift` file for use with the Swift Package Manager. As SwiftPM is not yet stable, this integration should be considered an early preview and may break.

Linux Support
=============
Complementing SwiftPM support, Nimble can now be used on Linux, with the caveat that not all behaviors and matchers are supported. Features that rely on the Objective-C runtime are disabled in this environment.

Miscellaneous
=============
* `be` can now be used as an alias for the `beIdenticalTo` matcher. Thanks @jwfriese!
* The compiler will now produce a warning if `expect` is used without being followed up by `to`, `toNot`, etc. Thanks @pcantrell!
* `NSData` now has a special string representation to prevent failure messages from including excessively long data descriptions. Thanks @inket!

v3.1.0

Toggle v3.1.0's commit message

Verified

This tag was signed with the committer’s verified signature.
jeffh Jeff Hui
Nimble v3.1.0

=============

This is a bug fix + feature addition release. Thanks to @jwfriese for the work
in this release.

Note that this release does not include a pre-built binary for Carthage. Xcode
doesn't gaurantee binary compatibility for pre-built frameworks. See more
details: Carthage/Carthage#924.

On to the changes...

New Matcher: || (aka - satisfyAnyOf)
-------------------------------------

Matchers can be combined using the `||` operator:

```swift
expect(value).to(equal(2) || equal(3))
```

This expects `value` to be either 2 or 3. Using `||` can be useful in complex
expectations or integration tests, where less-specific expectations are usually
utilized.

Warning: Conditionals in expectations are generally considered bad practice.
Using `||` is a form of conditional that weakens the strength of the assertion.
This matcher should be used sparingly if at all.

Updated Matcher: Equals + Optional Collections
----------------------------------------------

Equals now supports optional collections:

```swift
let a: [String?] = ["a", "b", nil]
let b: [String?] = ["a", "b", nil]

expect(a).to(equal(b))
```

Previously, the above code caused a compiler error. Now this will work like
non-optional collection types.

Asynchronous Expectations
-------------------------

Async expectations have been rewritten to reduce flakiness. The public API
remains the same but uses lower-level features to avoid complex interactions
with common run loop features.

Async expectations are any `waitUntil` or `expect(..).toEventually(..)` forms.

Nimble also now more clearly emits errors on invalid usages of async
expectations:

- Async expectations must be done on the main thread.
- Async expectations cannot be nested.

This is because async requires controlling the main run loop. These limitations
were part of the old implementation, but left the test writer to discover them
via flaky tests. The new implementation will immediately fail.

v3.0.0

Toggle v3.0.0's commit message

Verified

This tag was signed with the committer’s verified signature.
jeffh Jeff Hui
Nimble v3.0.0

================

This release supports Xcode 7.1 with better tvOS support.

Changes:

- tvOS is a separate build target from iOS.
- updated import headers to be relative from module-based for Xcode 7.1
- revert waitUntil variadic completion function to avoid ambiguities for some edge cases
- fix haveCount matcher's expected and actual values reversed in expectation message

v2.0.0

Toggle v2.0.0's commit message

Verified

This tag was signed with the committer’s verified signature.
jeffh Jeff Hui
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 for `beEmpty`. `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 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(...));

Changes
-------

- beEmpty() matcher is now defined specifically for String
- `beCloseTo` now works with `NSDate` without having to convert it
- Cocoapod users can now run Nimble in devices
- objc: Added fail() and failWithMessage() 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() 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 throwError() 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

v2.0.0-rc.3

Toggle v2.0.0-rc.3's commit message

Verified

This tag was signed with the committer’s verified signature.
jeffh Jeff Hui
Nimble v2.0.0 Release Candidate 3

=================================

This release is compatible with Xcode 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 with `NSDate` without having to convert it
- Cocoapod users can now run Nimble in devices
- objc: Added fail() and failWithMessage() functions

v2.0.0-rc.2

Toggle v2.0.0-rc.2's commit message

Verified

This tag was signed with the committer’s verified signature.
jeffh Jeff Hui
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:

    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

v1.0.0

Toggle v1.0.0's commit message

Verified

This tag was signed with the committer’s verified signature.
jeffh Jeff Hui
Nimble 1.0.0

============

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
---------------------------

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