Re: [rspec-users] newbie cucumber tutorial

2011-11-16 Thread aslak hellesoy
On Wed, Nov 16, 2011 at 5:45 PM, Chris Habgood wrote: > this group is for rspec > The Cucumber list -> http://groups.google.com/group/cukes > On Wed, Nov 16, 2011 at 11:34, Vin MR wrote: >> >> I'm new with Ruby and Cucumber.  I've tried this simple test, but it >> didn't work for me >> >> Give

Re: [rspec-users] newbie cucumber tutorial

2011-11-16 Thread aslak hellesoy
On Wed, Nov 16, 2011 at 5:34 PM, Vin MR wrote: > I'm new with Ruby and Cucumber.  I've tried this simple test, but it > didn't work for me > > Given > When I enter ABC on keyboard > Then ... > > > And here is the ruby code > When /^I enter "([^\"]*) on keyboard$/ do |input| That RegExp doesn

Re: [rspec-users] newbie cucumber tutorial

2011-11-16 Thread David Chelimsky
On Nov 16, 2011, at 11:34 AM, Vin MR wrote: > I'm new with Ruby and Cucumber. I've tried this simple test, but it > didn't work for me Please send this to the Cucumber mailing list: http://groups.google.com/group/cukes Cheers, David ___ rspec-users

Re: [rspec-users] newbie cucumber tutorial

2011-11-16 Thread Chris Habgood
this group is for rspec On Wed, Nov 16, 2011 at 11:34, Vin MR wrote: > I'm new with Ruby and Cucumber. I've tried this simple test, but it > didn't work for me > > Given > When I enter ABC on keyboard > Then ... > > > And here is the ruby code > When /^I enter "([^\"]*) on keyboard$/ do |i

Re: [rspec-users] newbie cucumber tutorial

2008-12-24 Thread Mark Wilden
On Wed, Dec 24, 2008 at 1:32 AM, Matt Wynne wrote: > Is that some kind of trick to create multiple >> inheritance? >> > > Not really in that particular case. Ruby modules generally allow you to do > multiple inheritance by 'mixing in' behaviour to classes, but that would be > when you use 'inclu

Re: [rspec-users] newbie cucumber tutorial

2008-12-24 Thread Matt Wynne
On 24 Dec 2008, at 02:26, Sarah Allen wrote: Matt Wynne wrote: ActiveRecord::Validations uses a trick that's used widely in rails, and is arguably[1] becoming a Ruby idiom, apparently. This is the interesting bit, around line #275: def self.included(base) # :nodoc: base.extend Clas

Re: [rspec-users] newbie cucumber tutorial

2008-12-23 Thread Jeremiah Heller
On 23 Dec 2008, at 23:07, Jeremiah Heller wrote: On 23 Dec 2008, at 18:26, Sarah Allen wrote: Matt Wynne wrote: ActiveRecord::Validations uses a trick that's used widely in rails, and is arguably[1] becoming a Ruby idiom, apparently. This is the interesting bit, around line #275: def se

Re: [rspec-users] newbie cucumber tutorial

2008-12-23 Thread Jeremiah Heller
On 23 Dec 2008, at 18:26, Sarah Allen wrote: Matt Wynne wrote: ActiveRecord::Validations uses a trick that's used widely in rails, and is arguably[1] becoming a Ruby idiom, apparently. This is the interesting bit, around line #275: def self.included(base) # :nodoc: base.extend Class

Re: [rspec-users] newbie cucumber tutorial

2008-12-23 Thread Sarah Allen
Matt Wynne wrote: > ActiveRecord::Validations uses a trick that's used widely in rails, > and is arguably[1] becoming a Ruby idiom, apparently. > > This is the interesting bit, around line #275: > > def self.included(base) # :nodoc: >base.extend ClassMethods > > So basically that me

Re: [rspec-users] newbie cucumber tutorial

2008-12-23 Thread Tim Walker
Ahh...reality is overrated. Thanks again for your help guys. Making a lot of sense. If I could get rcumber working that's be awesome. Tim On Tue, Dec 23, 2008 at 4:39 PM, aslak hellesoy wrote: > > > On Wed, Dec 24, 2008 at 12:10 AM, Tim Walker wrote: >> >> Very nice indeed... >> >> >> In your

Re: [rspec-users] newbie cucumber tutorial

2008-12-23 Thread aslak hellesoy
On Wed, Dec 24, 2008 at 12:10 AM, Tim Walker wrote: > Very nice indeed... > > > In your blog you said: > > "Note that one of the steps is already defined in webrat. Isn't that > cool? As you get the hang of this, you reuse certain word patterns > which map to specific tests. But we're getting ahe

Re: [rspec-users] newbie cucumber tutorial

2008-12-23 Thread Tim Walker
Very nice indeed... In your blog you said: "Note that one of the steps is already defined in webrat. Isn't that cool? As you get the hang of this, you reuse certain word patterns which map to specific tests. But we're getting ahead of ourselves. We need to dive into the creation of "steps" which

Re: [rspec-users] newbie cucumber tutorial

2008-12-23 Thread Matt Wynne
On 22 Dec 2008, at 19:09, Sarah Allen wrote: I realize this is off-topic for the RSpec forum and cucumber tutorial, but I'm hoping you'll enlighten me on this point which is, I guess, more of a Ruby language question... My Task model is simply defined (by the generate scaffold script) as: c

Re: [rspec-users] newbie cucumber tutorial

2008-12-22 Thread Caius Durling
On 22 Dec 2008, at 22:57, Sarah Allen wrote: Oddly, I didn't see any content to the post by Caius Durling via ruby-forum ( http://www.ruby-forum.com/topic/174015?reply_to=762550#762530 ) How weird, wonder if its because I signed the email with my GPG key. Have sent this one unsigned so let

Re: [rspec-users] newbie cucumber tutorial

2008-12-22 Thread Sarah Allen
You guys are awesome. For posterity, I've written up a bit about the bang vs. non-bang as an aside in the tutorial: http://www.ultrasaurus.com/code/2008/12/rails-2-day-3.html#syntax I'll have to read up on modules. (I've only just finished ch 3 of the humble ruby book.) Oddly, I didn't see a

Re: [rspec-users] newbie cucumber tutorial

2008-12-22 Thread Steve Molitor
+1 @ Pat I was going to respond in more detail, but I do exactly what Pat does -- bang in steps, no bang in Rails apps. The Rails scaffolding boiler plate generates no bangs. Steve On Mon, Dec 22, 2008 at 2:30 PM, Pat Maddox wrote: > On Mon, Dec 22, 2008 at 11:29 AM, Caius Durling wrote: > >

Re: [rspec-users] newbie cucumber tutorial

2008-12-22 Thread Pat Maddox
On Mon, Dec 22, 2008 at 11:29 AM, Caius Durling wrote: > > On 22 Dec 2008, at 17:18, aslak hellesoy wrote: > > Essentially, #create will never raise an error no matter what you pass it, > and you actually want exceptions for bad input in your tests (step > definitions). > Therefore - use #create!

Re: [rspec-users] newbie cucumber tutorial

2008-12-22 Thread aslak hellesoy
On Mon, Dec 22, 2008 at 8:09 PM, Sarah Allen wrote: > I realize this is off-topic for the RSpec forum and cucumber tutorial, > but I'm hoping you'll enlighten me on this point which is, I guess, more > of a Ruby language question... > > Aslak Hellesøy wrote: > >> As you can see from my series of

Re: [rspec-users] newbie cucumber tutorial

2008-12-22 Thread Caius Durling
On 22 Dec 2008, at 17:18, aslak hellesoy wrote: Essentially, #create will never raise an error no matter what you pass it, and you actually want exceptions for bad input in your tests (step definitions). Therefore - use #create! (or #save!). In your app, use the non-bang methods. Use th

Re: [rspec-users] newbie cucumber tutorial

2008-12-22 Thread Sarah Allen
I realize this is off-topic for the RSpec forum and cucumber tutorial, but I'm hoping you'll enlighten me on this point which is, I guess, more of a Ruby language question... Aslak Hellesøy wrote: >> As you can see from my series of blog posts, I'm >> new to Ruby and Rails. I thought that endin

Re: [rspec-users] newbie cucumber tutorial

2008-12-22 Thread aslak hellesoy
On Mon, Dec 22, 2008 at 5:59 PM, Sarah Allen wrote: > Aslak Hellesøy wrote: > > * I released 0.1.13 yesterday. In the Rails installation wiki page I > > recommend using my webrat gem. It lets you use response.should > > have_selector(...) (You're not using it in your tutorial, but just in > > cas

Re: [rspec-users] newbie cucumber tutorial

2008-12-22 Thread Sarah Allen
Aslak Hellesøy wrote: > * I released 0.1.13 yesterday. In the Rails installation wiki page I > recommend using my webrat gem. It lets you use response.should > have_selector(...) (You're not using it in your tutorial, but just in > case...) Luckily I started with cucumber on Sunday just after your

Re: [rspec-users] newbie cucumber tutorial

2008-12-22 Thread aslak hellesoy
On Mon, Dec 22, 2008 at 10:01 AM, Sarah Allen wrote: > I got started with cucumber and it sure is fun. I've written up my > initial experience in tutorial format here for any newbies who want to > follow in my tracks: > http://www.ultrasaurus.com/code/2008/12/rails-2-day-3.html > > If anyone has

Re: [rspec-users] newbie cucumber tutorial

2008-12-22 Thread Matt Wynne
Great stuff. One thing I'd point out is the missing (and extremely important) step 3.5 in Rick Denatale's TDD steps: *Refactor to remove duplication*. Not that there's any refactoring necessary in your example, but it's always worth reminding people they should check for it. On 22 Dec 200