pivotal/jasmine — Issue #154: Combine matchers
Author: iainbeeston
Created: 2011-11-01 11:40:36+00:00
State: open

It would be great if it was possible to combine together matchers using boolean "and" and "or". For example, sometimes the object I'm testing is ok if it's in either of two states, and it would be great to be able to say:

expect(num).toEqual(NaN).or.toEqual(null)

There's some subtlety here surrounding not, for example I'd imagine that in:

expect(num).not.toEqual(NaN).or.toEqual(null)

not would bind more tightly than or.

Sorry I haven't contributed any code to achieve this! If I get time I might have a go

Thanks!