[rspec-users] Extending RSpec- Best Practices?

2009-05-06 Thread Nicholas Van Weerdenburg
Hi, I'm reading the RSpec book and it makes references to macros from shoulda and rspec_on_rail_on_crack, but doesn't integrate them, simply describing how to write your own macro. I see there is the "Remarkable" project as well. After some more googling, I can't make up my mind if I should use th

[rspec-users] cucumber segfaults

2009-05-06 Thread Matthew Van Horn
Just started getting this, every time I run rake features: myapp/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/ rack/lint.rb:16: [BUG] Segmentation fault ruby 1.8.6 (2008-03-03) [i686-darwin9.2.2] after updating from cucumber 0.3.0 to 0.3.2 I'm now getting the segfault here:

Re: [rspec-users] DB transactions w/ RSpec

2009-05-06 Thread Nicholas Van Weerdenburg
As far as I can tell, RSpec simply uses inherited TestCase capabilities for transactions, including use_transactional_fixtures (it's config setting is simply passed on) and likely uses_transaction. I'm guessing you can do something like: uses_transaction :create it "should save message" d

[rspec-users] have_selector only matching immediate descendants in block

2009-05-06 Thread doug livesey
Hi -- I have an expectation that looks like this: it "should display a field for the username" do do_render response.should have_selector( "form" ) do |form| form.should have_selector( "input", :name => "username" ) end end That gives me this error: 'session/new.html.ham

[rspec-users] Cucunber - does not honour here-document syntax?

2009-05-06 Thread James Byrne
something_steps.rb TEST = 'A constant' puts TEST SCRIPT <<-'END_SCRIPT' ... END_SCRIPT Then /.../ do $ cucumber -r features features/lib/something.feature A constant ./features/lib/step_definitions/something__steps.rb:9: undefined method `SCRIPT' for # (NoMethodError) from /usr/lib/rub

Re: [rspec-users] Cucunber - does not honour here-document syntax?

2009-05-06 Thread aslak hellesoy
It's Ruby, not Cucumber that parses .rb files. (Even if you have ruby code that uses the Cucumber API in them). You have a Ruby syntax error. You missed the = sign after SCRIPT ;-) Aslak something_steps.rb > > TEST = 'A constant' > > puts TEST > > SCRIPT <<-'END_SCRIPT' > ... > END_SCRIPT > > Th

Re: [rspec-users] have_selector only matching immediate descendants in block

2009-05-06 Thread David Chelimsky
On Wed, May 6, 2009 at 7:14 AM, doug livesey wrote: > Hi -- I have an expectation that looks like this: > >   it "should display a field for the username" do >     do_render >     response.should have_selector( "form" ) do |form| >   form.should have_selector( "input", :name => "username" ) >

Re: [rspec-users] Cucunber - does not honour here-document syntax?

2009-05-06 Thread James Byrne
Aslak Hellesøy wrote: > It's Ruby, not Cucumber that parses .rb files. (Even if you have ruby > code > that uses the Cucumber API in them). > > You have a Ruby syntax error. You missed the = sign after SCRIPT ;-) > > Aslak > > something_steps.rb Sigh... -- Posted via http://www.ruby-forum.com

Re: [rspec-users] have_selector only matching immediate descendants in block

2009-05-06 Thread doug livesey
Will do -- cheers! 2009/5/6 David Chelimsky > On Wed, May 6, 2009 at 7:14 AM, doug livesey wrote: > > Hi -- I have an expectation that looks like this: > > > > it "should display a field for the username" do > > do_render > > response.should have_selector( "form" ) do |form| > >

[rspec-users] Features failing to run correctly under 0.3.2

2009-05-06 Thread Andrew Premdas
Having significant problems getting an upto date environment with cucumber and rspec since 0.3.0. I have put the relevant files including a backtrace in a gist http://gist.github.com/107586. I'd really appreciate it if someone could take a look at this. All these features ran fine using cuc 0.3.0

Re: [rspec-users] DB transactions w/ RSpec

2009-05-06 Thread Francis Hwang
On Wed, May 6, 2009 at 9:47 AM, Nicholas Van Weerdenburg wrote: > As far as I can tell, RSpec simply uses inherited TestCase capabilities for > transactions, including use_transactional_fixtures (it's config setting is > simply passed on) and likely uses_transaction. > I'm guessing you can do some

Re: [rspec-users] Features failing to run correctly under 0.3.2

2009-05-06 Thread aslak hellesoy
> Having significant problems getting an upto date environment with cucumber > and rspec since 0.3.0. I have put the relevant files including a backtrace > in a gist http://gist.github.com/107586. I'd really appreciate it if > someone could take a look at this. > All these features ran fine using

Re: [rspec-users] Features failing to run correctly under 0.3.2

2009-05-06 Thread aslak hellesoy
On Wed, May 6, 2009 at 9:20 AM, Andrew Premdas wrote: > Having significant problems getting an upto date environment with cucumber > and rspec since 0.3.0. I have put the relevant files including a backtrace > in a gist http://gist.github.com/107586. I'd really appreciate it if > someone could t

[rspec-users] [cucumber] How to DRY up table data that I'm seeing across tests ?

2009-05-06 Thread John Goodsen
I have the following step that I want to re-use in several scenarios. It looks like this: When I submit the form |form_field_id |value| |billingAddress.email|mickey_mo...@test.com| |billingAddress.firstName|Mickey| |billingAddress.lastName |Mouse| |bi

Re: [rspec-users] [cucumber] How to DRY up table data that I'm seeing across tests ?

2009-05-06 Thread John Goodsen
Another thing I'm looking into is trying to hook into the visitor/formatting stuff and just spit out the extra data fixture data when the test runs... thoughts anyone? On Wed, May 6, 2009 at 2:13 PM, John Goodsen wrote: > I have the following step that I want to re-use in several scenarios. It

Re: [rspec-users] Extending RSpec- Best Practices?

2009-05-06 Thread Matt Wynne
On 6 May 2009, at 14:52, Nicholas Van Weerdenburg wrote: Hi, I'm reading the RSpec book and it makes references to macros from shoulda and rspec_on_rail_on_crack, but doesn't integrate them, simply describing how to write your own macro. I see there is the "Remarkable" project as well.

Re: [rspec-users] [cucumber] How to DRY up table data that I'm seeing across tests ?

2009-05-06 Thread Julian Leviston
Hehe. It's funny I was after something just like this about a week ago... Basically it'd be cool if there was an option to get cucumber to explicitly say (on running) exactly which steps it was doing, regardless of whether they were in a .feature file, or a _steps.rb file. Julian.

Re: [rspec-users] [cucumber] How to DRY up table data that I'm seeing across tests ?

2009-05-06 Thread aslak hellesoy
> I have the following step that I want to re-use in several scenarios. It > looks like this: > > When I submit the form >|form_field_id |value| >|billingAddress.email|mickey_mo...@test.com| >|billingAddress.firstName|Mickey| >|billingAddress.lastName

[rspec-users] top posting and plain text

2009-05-06 Thread aslak hellesoy
Folks, I find it really hard to follow conversations that use top posting ( http://en.wikipedia.org/wiki/Posting_style). If you have a [Cucumber] topic, please respond with inline comments. And use plain text email - not html. Thanks, Aslak ___ rspec-us

Re: [rspec-users] [cucumber] How to DRY up table data that I'm seeing across tests ?

2009-05-06 Thread Matt Wynne
On 6 May 2009, at 19:28, John Goodsen wrote: Another thing I'm looking into is trying to hook into the visitor/ formatting stuff and just spit out the extra data fixture data when the test runs... thoughts anyone? On Wed, May 6, 2009 at 2:13 PM, John Goodsen wrote: I have the following s

Re: [rspec-users] DB transactions w/ RSpec

2009-05-06 Thread Nicholas Van Weerdenburg
The rails code is pretty straightforward: def uses_transaction(*methods) @uses_transaction = [] unless defined?(@uses_transaction) @uses_transaction.concat methods.map(&:to_s) end def uses_transaction?(method) @uses_transaction = [] unless defined?(@uses_transa

Re: [rspec-users] top posting and plain text

2009-05-06 Thread Julian Leviston
On 07/05/2009, at 4:54 AM, aslak hellesoy wrote: Folks, I find it really hard to follow conversations that use top posting (http://en.wikipedia.org/wiki/Posting_style ). If you have a [Cucumber] topic, please respond with inline comments. And use plain text email - not html. I find it

Re: [rspec-users] DB transactions w/ RSpec

2009-05-06 Thread Francis Hwang
Yeah, that worked for me, thanks. And for whatever reason nesting was part of the problem, but if I put it all in one top-level describe with the examples below it worked fine. FH On Wed, May 6, 2009 at 2:42 PM, Nicholas Van Weerdenburg wrote: > The rails code is pretty straightforward: >   def

Re: [rspec-users] [cucumber] How to DRY up table data that I'm seeing across tests ?

2009-05-06 Thread John Goodsen
> Why not write a wrapper step, something like > > Given /I submit the billing address form with valid data/ do > submit_form { >:email => 'mickey_mo...@test.com', >:firstName => 'Mickey'} # etc > end > > And call that from your feature? Do you really need to see all the fields > in the fo

Re: [rspec-users] Cucumber - wierd button pressing error

2009-05-06 Thread Mischa Fierer
Hi - I vaguely remember having a similar problem. >From what I remember, this has to do with upgrading to rails 2.3.2 and having older versions of gems / plugins (like webrat, nokogiri, resources_controller, resource_controller etc) http://blog.adambair.com/post/89557713/cucumber-webrat-and-uninit

Re: [rspec-users] top posting and plain text

2009-05-06 Thread Ben Mabey
+ 1 aslak hellesoy wrote: Folks, *snip* Thanks, Aslak ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users ___ rspec-users mailing list rspec-u

Re: [rspec-users] top posting and plain text

2009-05-06 Thread Rick DeNatale
On Wed, May 6, 2009 at 7:33 PM, Ben Mabey wrote: > + 1 > > > aslak hellesoy wrote: > > Folks, > > *snip* > > Thanks, > Aslak So let me get this right, you agreed with Aslak that you shouldn't top post. by top posting -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: htt

Re: [rspec-users] top posting and plain text

2009-05-06 Thread Ben Mabey
Rick DeNatale wrote: On Wed, May 6, 2009 at 7:33 PM, Ben Mabey wrote: + 1 aslak hellesoy wrote: Folks, *snip* Thanks, Aslak So let me get this right, you agreed with Aslak that you shouldn't top post. by top posting lol.. Yes. :) Sarcasm somethings doesn't come acr

Re: [rspec-users] top posting and plain text

2009-05-06 Thread Steve Schafer
Just so you know, _your_ message isn't just plain text. Here's a portion of the raw message: >--===0527642389== >Content-Type: multipart/alternative; boundary=001636c5b0eedf7860046942ecfc > >--001636c5b0eedf7860046942ecfc >Content-Type: text/plain; charset=ISO-8859-1 >Content-Transfer-

Re: [rspec-users] top posting and plain text

2009-05-06 Thread Francis Hwang
How about both top and bottom posting? Francis Hwang http://fhwang.net/ On May 6, 2009, at 8:46 PM, Ben Mabey wrote: lol.. Yes. :) Sarcasm somethings doesn't come across well over email I suppose. How about both top and bottom posting? Francis Hwang http://fhwang.net/ __

Re: [rspec-users] top posting and plain text

2009-05-06 Thread Andrew Vit
On May 6, 2009, at 5:28 PM, Rick DeNatale wrote: On Wed, May 6, 2009 at 7:33 PM, Ben Mabey wrote: + 1 aslak hellesoy wrote: Folks, *snip* Thanks, Aslak So let me get this right, you agreed with Aslak that you shouldn't top post. by top posting And Aslak's post was multipart/mim

Re: [rspec-users] top posting and plain text

2009-05-06 Thread Nicholas Van Weerdenburg
Nick: How about On Wed, May 6, 2009 at 9:09 PM, Francis Hwang < s...@fhwang.net> wrote: > side posting How about both top and bottom posting? > as a > compromise? Francis Hwang > http://fhwang.net/ > > On May 6, 2009, at 8:46 PM, Be

Re: [rspec-users] Features failing to run correctly under 0.3.2

2009-05-06 Thread Andrew Premdas
2.2.2 at the moment. 2009/5/6 aslak hellesoy > > Having significant problems getting an upto date environment with cucumber >> and rspec since 0.3.0. I have put the relevant files including a backtrace >> in a gist http://gist.github.com/107586. I'd really appreciate it if >> someone could take

Re: [rspec-users] Features failing to run correctly under 0.3.2

2009-05-06 Thread Andrew Premdas
Thanks Aslak, I'll try this out when I get to work. Andrew 2009/5/6 aslak hellesoy > > > On Wed, May 6, 2009 at 9:20 AM, Andrew Premdas wrote: > >> Having significant problems getting an upto date environment with cucumber >> and rspec since 0.3.0. I have put the relevant files including a bac