[rspec-users] Documentation for Plain-Text Stories
Aslak Hellesøy
aslak.hellesoy at gmail.com
Wed Aug 20 02:20:07 EDT 2008
On Aug 20, 2008, at 7:04 AM, Jim Morris wrote:
> Aslak Hellesøy wrote:
>
>> Right now the scope of Before/After is global - i.e. all Before and
>> After blocks will run before and after each scenario. I have
>> deliberately postponed adding scoping of this until I better
>> understand how people want to define this scoping.
>> Here is one ideas:
>> class MySteps < Cucumber::Steps # Same as Story runnner
>> steps_for(:my)
>> Before do
>> # This block will run before all scenarios that use steps from
>> MySteps
>> # Any scenarios not using any of these will not have this block
>> run
>> end
>> Given /bla bla/ do
>> end
>> end
>> I'm open to other ideas too.
>
> I'd like to have a before story and after story as well as a before
> scenario and after scenario.
>
> Right now I do global setup for a story, and cleanup when the story
> is done. I also do a setup before each scenario as well.
>
> It would be nice to have the ability to do both.
Can you give me a code example? (In Cucumber it's Feature, not Story)
Aslak
>
>
> Thanks
>
> --
> Jim Morris, http://blog.wolfman.com
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
More information about the rspec-users
mailing list