I was reading http://code.google.com/p/specs/wiki/MatchersGuide and wondered if new matchers could be defined more tersely than:
So here it is, with a couple of implicits:
The example shows how to promote a function to a matcher. Currently I didn't find how to define
a function literal with call-by-name semantics, but for simple matchers where a call-by-value semantic is acceptable this trick works fine.
Monday, December 13, 2010
Subscribe to:
Post Comments (Atom)
You can have a look at the new ways to create matchers in specs2, they are much easier to create now.
ReplyDelete