Monday, November 16, 2015

Nimble Matcher Framework


Use Nimble to express the expected outcomes of Swift or Objective-C expressions. Inspired by Cedar.

// Swift

expect(1 + 1).to(equal(2))
expect(1.2).to(beCloseTo(1.1, within: 0.1))
expect(3) > 2
expect(["Atlantic", "Pacific"]).toNot(contain("Mississippi"))

BDD has never felt right to me, but I do like using a layer on top of XCTest’s macros because they are both verbose and incomplete.

Comments RSS · Twitter

Leave a Comment