[rspec-users] Cucumber feature checking sort order of list

Matt Wynne matt at mattwynne.net
Wed Nov 12 11:12:07 EST 2008

On 12 Nov 2008, at 16:03, Joaquin Rivera Padron wrote:
> > Matt Wynne:
> How about something more like
>    Given there are two items in a list: "Zulu and Abba"
>    And I have sorted the list alphabetically
>    Then "Abba" should appear before "Zulu"
> Then /"(.*)" should appear before "(.*)"/ do |first_example,  
> second_example|
>    response.body.should =~ /#{first_example}.*#{second_example}/
> end
> yep, this one looks better to me
> thanks Matt

Might not compile - I wrote it in my email client ;)

The looser the better with these, IMO. Just enough to catch your code  
being broken, not a bit more.


More information about the rspec-users mailing list