[rspec-users] calling multiline steps from other steps

Andrew Premdas apremdas at gmail.com
Fri Dec 5 05:44:56 EST 2008


Ooh interesting stuff thanks for that Ben, never got past the scenario
tables until now :)

Andrew

2008/12/5 Ben Mabey <ben at benmabey.com>

> Andrew Premdas wrote:
>
>> Given /^I have filled in the form$/ do |details|
>>  details.hashes.each |pair|
>>
>> Can't see this working because you've got no place to collect details
>>
>> However
>>
>> Given /^I have filled in the form with (.*)$/ do |details|
>>  details.hashes.each |pair|
>>
>> would work, but you'd have to do some tricky stuff to get your hash out.
>>
>>  <snip>
>
>>
>> but I doubt that would work as I think you need the "More Examples:"
>> statement. Also don't think embedding tables in step definitions is a good
>> idea.
>>
>>
> Actually, you can embed tables in steps, they are called "Step Tables". :)
>  Read about them here:
>
> http://github.com/aslakhellesoy/cucumber/wikis/using-fit-tables-in-a-feature
>
> I have used them many times and I find them very handy.  I had rolled my
> own with story runner and so having it built into cucumber makes things very
> nice.
>
> -Ben
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081205/4a0e630f/attachment.html>


More information about the rspec-users mailing list