Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-16 Thread Zach Dennis
On Mon, Sep 15, 2008 at 9:34 AM, aslak hellesoy <[EMAIL PROTECTED]> wrote: > On Mon, Sep 15, 2008 at 3:27 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: >> On Mon, Sep 15, 2008 at 8:21 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: >>> On Mon, Sep 15, 2008 at 8:13 AM, aslak hellesoy >>> <[EMAIL PRO

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-15 Thread aslak hellesoy
On Mon, Sep 15, 2008 at 4:00 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Mon, Sep 15, 2008 at 8:55 AM, Joseph Wilk-2 > <[EMAIL PROTECTED]> wrote: >> >>>I like this much better. -Guiding people to use regexen properly is >>>better than redefining their semantics. >> >> Well put. Do you mind

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-15 Thread David Chelimsky
On Mon, Sep 15, 2008 at 8:55 AM, Joseph Wilk-2 <[EMAIL PROTECTED]> 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

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-15 Thread Joseph Wilk-2
>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? Thanks, Joseph Wilk -- View this message in context: http://www.nabble.com/Cucumber---Ambiguous-steps-tp19480001p19493430.html Sent from th

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-15 Thread Joseph Wilk
David Chelimsky wrote: > On Mon, Sep 15, 2008 at 8:21 AM, David Chelimsky <[EMAIL PROTECTED]> > wrote: >> anyone have good examples where they would? >>> 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

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-15 Thread aslak hellesoy
On Mon, Sep 15, 2008 at 3:27 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Mon, Sep 15, 2008 at 8:21 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: >> On Mon, Sep 15, 2008 at 8:13 AM, aslak hellesoy >> <[EMAIL PROTECTED]> wrote: >>> On Mon, Sep 15, 2008 at 3:07 PM, Joseph Wilk <[EMAIL PROTECT

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-15 Thread David Chelimsky
On Mon, Sep 15, 2008 at 8:21 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Mon, Sep 15, 2008 at 8:13 AM, aslak hellesoy > <[EMAIL PROTECTED]> wrote: >> On Mon, Sep 15, 2008 at 3:07 PM, Joseph Wilk <[EMAIL PROTECTED]> wrote: >>> David Chelimsky wrote: On Mon, Sep 15, 2008 at 3:54 AM, Jose

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-15 Thread David Chelimsky
On Mon, Sep 15, 2008 at 8:13 AM, aslak hellesoy <[EMAIL PROTECTED]> wrote: > On Mon, Sep 15, 2008 at 3:07 PM, Joseph Wilk <[EMAIL PROTECTED]> wrote: >> David Chelimsky wrote: >>> On Mon, Sep 15, 2008 at 3:54 AM, Joseph Wilk <[EMAIL PROTECTED]> >>> wrote: You can still use non-regular expressio

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-15 Thread aslak hellesoy
On Mon, Sep 15, 2008 at 3:07 PM, Joseph Wilk <[EMAIL PROTECTED]> wrote: > David Chelimsky wrote: >> On Mon, Sep 15, 2008 at 3:54 AM, Joseph Wilk <[EMAIL PROTECTED]> >> wrote: >>> You can still use non-regular expression steps in Cucumber: >>> >>> I've been unable to think of a good example where I

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-15 Thread Joseph Wilk
David Chelimsky wrote: > On Mon, Sep 15, 2008 at 3:54 AM, Joseph Wilk <[EMAIL PROTECTED]> > wrote: >> 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 char

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-15 Thread aslak hellesoy
On Mon, Sep 15, 2008 at 2:56 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Mon, Sep 15, 2008 at 7:49 AM, aslak hellesoy > <[EMAIL PROTECTED]> wrote: >> On Mon, Sep 15, 2008 at 2:40 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: >>> On Mon, Sep 15, 2008 at 3:54 AM, Joseph Wilk <[EMAIL PROTECTE

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-15 Thread David Chelimsky
On Mon, Sep 15, 2008 at 7:49 AM, aslak hellesoy <[EMAIL PROTECTED]> wrote: > On Mon, Sep 15, 2008 at 2:40 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: >> On Mon, Sep 15, 2008 at 3:54 AM, Joseph Wilk <[EMAIL PROTECTED]> wrote: >> Then /I should see "(.*)" in the page/ do |text| That

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-15 Thread aslak hellesoy
On Mon, Sep 15, 2008 at 2:40 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Mon, Sep 15, 2008 at 3:54 AM, Joseph Wilk <[EMAIL PROTECTED]> wrote: > Then /I should see "(.*)" in the page/ do |text| >>> >>> That should raise an AmbiguousStep error if you also have /I should >>> see "(.*)"/. >

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-15 Thread David Chelimsky
On Mon, Sep 15, 2008 at 3:54 AM, Joseph Wilk <[EMAIL PROTECTED]> wrote: Then /I should see "(.*)" in the page/ do |text| >> >> That should raise an AmbiguousStep error if you also have /I should >> see "(.*)"/. > > Oops sorry, thanks for spotting that David. > > It seems that it would be good

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-15 Thread Damian Jones
This is what I was trying to accomplish Then I should see "My product name" And I should see "My product description" And I should see "My product name was successfully saved." After reading all the comments above, the follwing step name solves my problem Then /I should see "(.*?)"$/ do |text|

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-15 Thread Joseph Wilk
>>> Then /I should see "(.*)" in the page/ do |text| > > That should raise an AmbiguousStep error if you also have /I should > see "(.*)"/. Oops sorry, thanks for spotting that David. It seems that it would be good practice to use $ and ^ in all your regular expression steps in order to minimis

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-14 Thread David Chelimsky
On Sep 14, 2008, at 9:39 AM, "Pat Maddox" <[EMAIL PROTECTED]> wrote: Then /I should see "(.*)" Then /I should see "(.*)" in the list of authors/ Both of these would respond to: Then I should see Aslak in the list of authors If you change the first one to Then /I should see "(.*?)"$/ then i

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-14 Thread Pat Maddox
> Then /I should see "(.*)" > Then /I should see "(.*)" in the list of authors/ > > Both of these would respond to: > > Then I should see Aslak in the list of authors If you change the first one to Then /I should see "(.*?)"$/ then it should no longer match that string. Tightening up the reg

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-14 Thread David Chelimsky
On Sun, Sep 14, 2008 at 9:13 AM, Joseph Wilk <[EMAIL PROTECTED]> wrote: > Hello, > > 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 approa

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-14 Thread Joseph Wilk
Hello, 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 |tex

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-14 Thread David Chelimsky
On Sun, Sep 14, 2008 at 7:39 AM, Damian Jones <[EMAIL PROTECTED]> wrote: > I know that cucumber does not allow ambiguous steps to stop duplication > of specs, It's not to stop duplication of specs, it's to avoid the possibility that you could write this: Then /I should see "(.*)" Then /I shou

[rspec-users] Cucumber - Ambiguous steps

2008-09-14 Thread Damian Jones
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/.