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

David Salgado david at digitalronin.com
Fri Jul 4 04:17:45 EDT 2008

> Unless you're looking for the steps to show up when you run things, why not
> just have a helper method that does the setup for you and then have a Given
> step that invokes that method?
>  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'm not sure understand this. Don't you have expectations (assertions) in
> all your Then steps?

Sure. I was just hoping I could keep my prereq stuff as a story in its own
right - more for clarity when discussing requirements than for any other
reason. If it's just a step or a helper method, then that particular story
is reduced to a one-liner. I know I could always do both, and not be 100%
DRY, so I guess that's what I'll do.

Thanks for the advice

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

More information about the rspec-users mailing list