[rspec-users] how do i remove duplication from my steps in story runner?

Perryn Fowler pezlists at gmail.com
Tue Apr 22 22:30:43 EDT 2008


>  Another attack.
>
>  Then("two nested divs and an? $type will be displayed") do | type |
>
>      response.should have_tag("div") do
>            with_tag("div")
>      end
>      response.should have_tag(type == 'image' ? 'img' : type)
>   end
>

Thanks for the cool idea Rick, but unfortunately that only helps with
my contrived little example -
 for my real app I really do need to be able to factor out some helper
methods...


More information about the rspec-users mailing list