[rspec-users] Cucumber - Ambiguous steps

David Chelimsky
Mon, 15 Sep 2008 14:00:54 -0000

On Mon, Sep 15, 2008 at 8:55 AM, Joseph Wilk-2
<josephwilk at joesniff.co.uk> wrote:
>
>>I like this much better. -Guiding people to use regexen properly is
>>better than redefining their semantics.
>
> Well put. Do you mind if I add this David?

Well - it turns out that this is slightly more complicated. The code
example in cucumber has these expressions:

/Three \(\.\*\) mice/
/Three blind \(\.\*\)/

The proposed hint in the error message (appending $) does not really
apply to this, and trying to cover all of the different possible
reasons for ambiguity in steps seems counter productive to me.

I did make one change
(http://github.com/dchelimsky/cucumber/commit/ca70b3795906448e40f4d610dd0b6692ce987f1a)
in my fork: I changed Amiguous to Multiple and the error message now
reads:

  Multiple step definitions match "Three blind mice":

  ./spec/cucumber/step_mother_spec.rb:24:in `/Three (.*) mice/''
  ./spec/cucumber/step_mother_spec.rb:27:in `/Three blind (.*)/''

I think this is a bit more clear than Ambiguous (that reads sorta
funny). Aslak - if you agree, go ahead and pull/merge that commit.

David

> Thanks,
> Joseph Wilk