[rspec-users] Cucumber - Ambiguous steps
dchelimsky at gmail.com
Mon Sep 15 09:27:48 EDT 2008
On Mon, Sep 15, 2008 at 8:21 AM, David Chelimsky <dchelimsky at gmail.com> wrote:
> On Mon, Sep 15, 2008 at 8:13 AM, aslak hellesoy
> <aslak.hellesoy at gmail.com> wrote:
>> On Mon, Sep 15, 2008 at 3:07 PM, Joseph Wilk <lists at ruby-forum.com> wrote:
>>> David Chelimsky wrote:
>>>> On Mon, Sep 15, 2008 at 3:54 AM, Joseph Wilk <lists at ruby-forum.com>
>>>>> You can still use non-regular expression steps in Cucumber:
>>>>> I've been unable to think of a good example where I would want only a
>>>>> partial match of a step. Throwing away the unmatched characters. Does
>>>>> anyone have good examples where they would?
>>>> I think you've got this right and exposed a bug. Wanna report it to
>>>> lighthouse and/or fix it?
>>> Sure I'll report it and write a patch.
>> Hold on.
>> If you want the regexp to match until the end of the string, why don't
>> you just stick a $ at the end of the Regexp?
>> That's how regexen work. I don't see why they should work any
>> differently when used in Cucumber.
> My previous comments withdrawn. I agree with Aslak.
Although, I can see why one might be confused by this. I was. Even
though these are regular expressions, the context led me to an
(erroneous, but intuitive) expectation that in the presence of these
/this and "(.*)"/
/this and "(.*)" and the other thing/
... that the first would not match "this and that and the other thing"
Perhaps a hint in the error message is in order?
When this and "that" and the other thing
Ambiguous step resolution for "this and \"that\" and the other thing":
./features//foo-steps.rb:4:in `/this and "(.*)" and the other thing/'
./features//foo-steps.rb:1:in `/this and "(.*)"/' (Cucumber::Ambiguous)
Consider ending the shorter expression with a $
>>> Joseph Wilk
More information about the rspec-users