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

2009-05-11 Thread aidy lewis
Hi Jean, 2009/5/9 Ben Mabey : > 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 pa

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 neg

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

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 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 Matchers (I

Re: [rspec-users] Where to spec authentication and roles-based permissions?

2009-05-11 Thread James Byrne
Doug Livesey wrote: > Hi -- I'm writing an app that both requires authentication via a logon, > and also has roles-based permissions (using acl_system2), ... I am at the point where a more complete authorisation system is required and I was wondering what others here would suggest for implementa

[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 wo

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 widget

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 usin

[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 ActiveSupport::JSON.decode(@r

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 ActiveSup

[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 http://rub

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 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 asking my questi

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 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 cor

Re: [rspec-users] Test JSON with Cucumber

2009-05-11 Thread Zach Dennis
On Mon, May 11, 2009 at 5:31 PM, Bill Kocik wrote: > On Mon, May 11, 2009 at 4:32 PM, Ben Mabey 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 abso

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

[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 something?

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 I

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 inclu

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 http://rub

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 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!

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 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. > > I have been

[rspec-users] [cucumber] junit formatter

2009-05-11 Thread Jones, Gareth
Hi, I've knocked together a JUnit xml output formatter for cucumber - we're using it with Hudson and Ant, so it seemed like a good idea. It's good enough for our purposes, so I thought we should release it into the wild, and see if it is useful for anyone else. Details here: http://csausde

Re: [rspec-users] rspec_scaffold and mocha

2009-05-11 Thread jevado
Wow, thanks for all the replies ... The rspec scaffold generates more tests than the nifty_scaffold. I didn't look into it in detail yet cause some of the nifty tests where failing too. What I did to get it workin is map the missing methods (used by respec) to methods in mocha. I also use the mis

Re: [rspec-users] rspec_scaffold and mocha

2009-05-11 Thread jevado
post wasn't finished yet ... I know that it's not very clean but since it's just for scaffolding and I'll probably rewrite most of the tests later on anyway it's acceptable for now. Thanks again and I'll monitor the GSOC project :) Kind regards, Jeroen On May 11, 3:17 am, Nicholas Van Weerdenbu