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

Zach Dennis zach.dennis at gmail.com
Wed Apr 23 13:20:17 EDT 2008


You should be able to make your own module of helpers and include it into
Spec::Story::World
module Spec::Story::World
  def your_helper_method
     # i should have access to everything I need
  end
end

Zach

On Tue, Apr 22, 2008 at 10:30 PM, Perryn Fowler <pezlists at gmail.com> wrote:

> >  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...
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>



-- 
Zach Dennis
http://www.continuousthinking.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20080423/7d9475cb/attachment-0001.html 


More information about the rspec-users mailing list