Expecty

29 views
Skip to first unread message

stephanos

unread,
Oct 21, 2012, 9:36:23 AM10/21/12
to specs2...@googlegroups.com
Hi,

I was wondering if there are any plans to leverage the new macro features to do something like expecty:
expect {
  person.name == "Fred"
  person.age * 2 == 84
  person.say("Hi", "from", "Expecty!") == "Hi from Expecty!"
}
Cheers
Stephan

etorreborre

unread,
Oct 21, 2012, 6:11:58 PM10/21/12
to specs2...@googlegroups.com
Hi Stephanos,

I actually plan to start working on 2.10 related features when it's officially out (more for lack of time than anything else) and Expecty is an interesting feature indeed.

You should be able to start using it now because when something fails Expecty throws an AssertionError that should be caught by specs2 (hmm, I might to make a slight change for this to be properly supported though, so that those "errors" are interpreted as specs2 "failures"). 

However, in the future I'll probably do a slightly different integration than the one using "expect" blocks because their functionality (fail the whole block after the first assertion fails or report all failures) overlaps with existing specs2 functionality (see the AllThrownExpectations trait). Also I have to integrate Expecty's reporting to the "be_==" matcher.

So this is quite some work and I need to get up to speed with the macro/reflection framework first!

Eric.

PS: also, I wonder how useful Expecty is in practice, with real-world data which can be quite verbose to display sometimes
Reply all
Reply to author
Forward
0 new messages