[rspec-users] [cucumber] Using worlds for loading fixtures

aslak hellesoy aslak.hellesoy at gmail.com
Fri Mar 13 07:17:48 EDT 2009


On Fri, Mar 13, 2009 at 11:37 AM, Pat Maddox <pat.maddox at gmail.com> wrote:

> On Mar 13, 2009, at 3:11 AM, Joseph Wilk wrote:
>
>  Fedor Fomenko wrote:
>>
>>> What is the right place to load fixtures specific to a given scenario? I
>>> was thinking of using Worlds. Is it the right place for loading/deleting
>>> fixtures? How do I specify which world scenario should run in?
>>>
>>>  There 3 options I can think of:
>>
>> 1. Background Feature
>> This allows you to specify specific set of  steps which are only run for
>> the scenarios in the relevant feature (
>> http://wiki.github.com/aslakhellesoy/cucumber/background). I would
>> recommend this approach if you are using the latest cucumber version from
>> github.
>>
>
> Makes sense if it applies to every scenario within a feature.
>
>
>  2, In the scenario
>> Are you hiding state setup which would be better placed in the plain text
>> scenario? You don't have to get too granular with the data setup, a high
>> level "Given the system is setup...." style could be used to avoid noise
>> that detracts from the scenario value.
>>
>
> What I do 99% of the time.
>
>
>  3. Before
>> If you do this in a Before you can gain access to the scenario name (
>> http://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/44). You
>> could switch this to run the relevant fixture if you wish. (This is a bit
>> smelly)
>>
>
> You could clean it up: http://gist.github.com/78518  but it's still
> horrible :P
>

How about this:
http://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/229-use-hooks-with-tags

Aslak


>
> Pat
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>



-- 
Aslak (::)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090313/eeec3ae5/attachment.html>


More information about the rspec-users mailing list