Re: [rspec-users] [cucumber] how to debug cucumber with netbeans?

2009-05-11 Thread aidy lewis
Hi Jean, 2009/5/9 Ben Mabey b...@benmabey.com: Jean-Michel Garnier wrote: 3 months ago, I submitted a patch to cucumber so I could run cucumber from a ruby script and use the debugger in netbeans Is it possible for you to Wiki how to use the Netbeans debugger through Cucumber and your

Re: [rspec-users] Sharing common Cuke steps

2009-05-11 Thread aidy lewis
Hi All It seems to me that there's an opportunity for packaging together and sharing steps, but am curious of folks thoughts on the best way to go about this. Mike Customer/Users are likely to have their 'own' language' and that providing library steps - could thus be argued - to negate

Re: [rspec-users] Sharing common Cuke steps

2009-05-11 Thread aslak hellesoy
Hi All It seems to me that there's an opportunity for packaging together and sharing steps, but am curious of folks thoughts on the best way to go about this. Mike Customer/Users are likely to have their 'own' language' and that providing library steps - could thus be argued -

Re: [rspec-users] Newbie: Rspec, Webrat, Mechanize, Cucumber

2009-05-11 Thread Mischa Fierer
contain is a webrat method. http://docs.rdocul.us/webrat/master/classes/Webrat/Matchers.html#M07 On Wed, May 6, 2009 at 7:08 PM, DVG devry...@gmail.com wrote: Alright, I'm trying to get up to speed with using Rspec, Webrat, Mechanize and Cucumber to test a non rails application. The

[rspec-users] question re: stubbing out validations

2009-05-11 Thread Barun Singh
Suppose a User has many widgets, and that we have a method in the User class that does something like: def update_widgets x = ... code to do some calculations ... if x 5 new_widget = widgets.new new_widget.save! else widgets.first.destroy end widgets.reload end How would

Re: [rspec-users] question re: stubbing out validations

2009-05-11 Thread Matt Wynne
On 11 May 2009, at 17:05, Barun Singh wrote: Suppose a User has many widgets, and that we have a method in the User class that does something like: def update_widgets x = ... code to do some calculations ... if x 5 new_widget = widgets.new new_widget.save! else

Re: [rspec-users] question re: stubbing out validations

2009-05-11 Thread Barun Singh
Yes, that mixture of mocking and database calls is what was giving me a lot of headache. And with my actual code more than one object might be created in the method so stubbing out the :new method would have added a lot of complication to my specs if I were to maintain good coverage. I tried

[rspec-users] Test JSON with Cucumber

2009-05-11 Thread Bill Kocik
Hi Folks - I'm hoping someone has come before me in trying to do this. I want to use Cucumber to acceptance-test my JSON output. So far all I can do is validate that the JSON is valid, with this step: Then /^I should get valid JSON$/ do assert_nothing_raised do

Re: [rspec-users] Test JSON with Cucumber

2009-05-11 Thread Ben Mabey
Bill Kocik wrote: Hi Folks - I'm hoping someone has come before me in trying to do this. I want to use Cucumber to acceptance-test my JSON output. So far all I can do is validate that the JSON is valid, with this step: Then /^I should get valid JSON$/ do assert_nothing_raised do

[rspec-users] Cucumber 0.3.3 - Examples:

2009-05-11 Thread James Byrne
Am I correct when I infer that the Examples keyword is now only valid in a Scenario Outline? If so, in what version did this change take place? -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org

Re: [rspec-users] [RSpec] implicit receiver for should problem when helper predicate methods are in use

2009-05-11 Thread Jarmo Pertman
Thanks for adding this change into repo! I'm quite surprised that anyone else haven't stumbled upon this problem yet. I guess it's because most of spec'ing is done for Ruby projects, so this functionality is not needed. I have been thinking a little more about this topic and asked myself: why not

Re: [rspec-users] Test JSON with Cucumber

2009-05-11 Thread Bill Kocik
On Mon, May 11, 2009 at 4:32 PM, Ben Mabey b...@benmabey.com wrote: Well.. IIRC ActiveSupport::JSON.decode will return a ruby hash of the JSON, correct?  So you should be able to make expectations on it just like a regular hash object. You're absolutely correct - I think I did a poor job of

Re: [rspec-users] Test JSON with Cucumber

2009-05-11 Thread Michael Schuerig
On Monday 11 May 2009, Bill Kocik wrote: On Mon, May 11, 2009 at 4:32 PM, Ben Mabey b...@benmabey.com wrote: Well.. IIRC ActiveSupport::JSON.decode will return a ruby hash of the JSON, correct? So you should be able to make expectations on it just like a regular hash object. You're

Re: [rspec-users] Test JSON with Cucumber

2009-05-11 Thread Zach Dennis
On Mon, May 11, 2009 at 5:31 PM, Bill Kocik bko...@gmail.com wrote: On Mon, May 11, 2009 at 4:32 PM, Ben Mabey b...@benmabey.com wrote: Well.. IIRC ActiveSupport::JSON.decode will return a ruby hash of the JSON, correct?  So you should be able to make expectations on it just like a regular

Re: [rspec-users] Cucumber 0.3.3 - Examples:

2009-05-11 Thread Ben Mabey
James Byrne wrote: Am I correct when I infer that the Examples keyword is now only valid in a Scenario Outline? If so, in what version did this change take place? Yes... Examples is only valid in Scenario Outlines, but you can also use Scenarios as well. I don't remember being able to

[rspec-users] Running single spec files -- how?

2009-05-11 Thread court3nay
Before upgrading from 1.1.11 to 1.2.4 I used to be able to do this: ruby spec/models/user_spec.rb Now it looks like you have to do script/spec spec/models/user_spec.rb Or something like this, which is actually kinda cool: script/spec spec/*/user* Is that correct? Am I missing

Re: [rspec-users] Running single spec files -- how?

2009-05-11 Thread Ben Mabey
court3nay wrote: Before upgrading from 1.1.11 to 1.2.4 I used to be able to do this: ruby spec/models/user_spec.rb Now it looks like you have to do script/spec spec/models/user_spec.rb Or something like this, which is actually kinda cool: script/spec spec/*/user* Is that correct? Am

Re: [rspec-users] Running single spec files -- how?

2009-05-11 Thread Scott Taylor
On May 11, 2009, at 7:10 PM, court3nay wrote: Before upgrading from 1.1.11 to 1.2.4 I used to be able to do this: ruby spec/models/user_spec.rb I would assume that would work if you are requiring test-unit interop mode. I believe in previous versions of rspec it was automatically

Re: [rspec-users] Test JSON with Cucumber

2009-05-11 Thread Bill Kocik
ooh - I love this solution. The downsides that immediately come to mind are that I'd be putting XPath expressions in my acceptance tests which aren't necessarily readable, but since I'm the only one who has to read them that's alright, and that I have to parse JSON into a hash, convert the hash to

Re: [rspec-users] Cucumber 0.3.3 - Examples:

2009-05-11 Thread James Byrne
Ben Mabey wrote: In short, I don't know what version this change happened in- sorry. It was just idle curiosity that prompted the question. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org

Re: [rspec-users] question re: stubbing out validations

2009-05-11 Thread Zach Dennis
On Mon, May 11, 2009 at 12:05 PM, Barun Singh baru...@gmail.com wrote: Suppose a User has many widgets, and that we have a method in the User class that does something like: def update_widgets   x = ... code to do some calculations ...   if x 5     new_widget = widgets.new    

Re: [rspec-users] [RSpec] implicit receiver for should problem when helper predicate methods are in use

2009-05-11 Thread David Chelimsky
On Mon, May 11, 2009 at 4:30 PM, Jarmo Pertman jarm...@gmail.com wrote: Thanks for adding this change into repo! I'm quite surprised that anyone else haven't stumbled upon this problem yet. I guess it's because most of spec'ing is done for Ruby projects, so this functionality is not needed.