[rspec-users] Re-use scenarios from another story file?

David Salgado david at digitalronin.com
Thu Jul 3 12:57:02 EDT 2008

Hi All

Is there a way to have "pre-requisite" story scenarios, and include them
using GivenScenario in a different story file?

i.e. I'd like to have a file "prereqs.story", with "Scenario: A common
setup", and then in "somestuff.story" have "GivenScenario: A common
setup...", and have the scenario go on from there.

I know I can extract logic into steps, but I'd like the pre-requisite
scenarios to have some assertions, and it doesn't feel right to put
assertions in steps (if that's possible).

I've had a dig through the rdoc and the source, and I couldn't figure out
whether it could be done, or how to do it. Is this kind of thing possible
and/or sensible?

Many thanks

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080703/7e96b1ca/attachment.html>

More information about the rspec-users mailing list