[rspec-users] Story Runner: DRYing items used in many stories

Andy Watts andywatts at yahoo.com
Sat Oct 13 23:47:31 EDT 2007

The number of stories I have is growing and I'm writing the following step
long hand in each story.

    Given 'a user named', 'Andy', 'Watts' do |first_name, family_name|
      @email = first_name + '@test.lan'
      create_user( :first_name => first_name, :family_name => family_name,
:email => @email )

It's great that this step is DRY for scenarios within a story.
I'm now wondering if it could be DRY across stories also.

Adding it once in stories/all.rb seems natural, but I couldn't get it to
Is this possible?  or perhaps a new feature request.

Wow, if reusable scenario steps were defined elsewhere, the whole story file
becomes accessible to non-coders....currently I would remove the guts from
steps in the first scenario before sharing the story file with non-coders.

Thanks again for a great set of tools.

View this message in context: http://www.nabble.com/Story-Runner%3A-DRYing-items-used-in-many-stories-tf4620490.html#a13195899
Sent from the rspec-users mailing list archive at Nabble.com.

More information about the rspec-users mailing list