[rspec-users] Cucumber - Ambiguous steps

Joseph Wilk lists at ruby-forum.com
Sun Sep 14 10:13:08 EDT 2008


Can you give an example of how you would want the step body of:

> Then /I should see "(.*)"/ do |text|

to be different.

I would aim for this step to be reusable. When I have conflicts I take 
the approach of adding context to such a step.

> Then /I should see "(.*)" in the page/ do |text|

Hence allowing different step bodies. Its up to you whether you bind 
'the page' and case/switch on this or just have different steps.

Joseph Wilk

Damian Jones wrote:
> I know that cucumber does not allow ambiguous steps to stop duplication
> of specs, but I ran into the problem of only being a ble to use the
> following step name once in the whole project
> Then /I should see "(.*)" do |text|
> What can I do to get round this?

Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list