Removal of should_be(), Hamcrest vs. FEST

11 views
Skip to first unread message

Eric Lefevre-Ardant

unread,
Nov 29, 2010, 4:52:03 AM11/29/10
to narrati...@googlegroups.com
Hi everyone,

Just upgraded to Narrative 1.0.

I wanted to mention that I rather liked the flow of reading made available by 'should_be' (but I do appreciate having less verbose code, too).

So my test went from

  Then.the(quant).expects_that(the_number_of_barcharts_for(CAC_40, EUR, Daily)).should_be(equalTo(1));

to

  Then.the(quant).expects_that(the_number_of_barcharts_for(CAC_40, EUR, Daily), equalTo(1));

An interesting side effect is that the signature of the 2-parameter expects_that() is now closer to the signature of the assertThat() method from JUnit 4. Probably a good thing when using Hamcrest matchers.

A natural conclusion is that, supposing that Narrative was to support FEST (which I might work on... some day), it could lead to a signature like this:

  Then.the(quant).expects_that(the_number_of_barcharts_for(CAC_40, EUR, Daily)).isEqualTo(1);

which would be closer to how FEST is often being used.

Of course, we (at Algodeal) also have our own wrappers around FEST. Integrating them with Narrative is probably quite hard.

Eric

Douglas Squirrel

unread,
Nov 29, 2010, 6:55:52 AM11/29/10
to narrati...@googlegroups.com
Thanks Eric. By FEST did you mean http://code.google.com/p/fest/?
________________________________________
From: narrati...@googlegroups.com [narrati...@googlegroups.com] On Behalf Of Eric Lefevre-Ardant [er...@ericlefevre.net]
Sent: 29 November 2010 09:52
To: narrati...@googlegroups.com
Subject: Removal of should_be(), Hamcrest vs. FEST

Eric Lefevre-Ardant

unread,
Nov 29, 2010, 8:04:30 AM11/29/10
to narrati...@googlegroups.com
yes. We only use the Fluent Assertions part.
Reply all
Reply to author
Forward
0 new messages