[rspec-users] newbie: how to preserve NoMethodError under stubbing?

2010-07-24 Thread Lille
Hi, I've been browsing the RSpec book and the RDoc, but I can't see how to ensure the following: Stub an instance with a method it doesn't have and raise NoMethodError (or something like it.) I want to do this because I don't want to use incorrect names for my dependency methods... Thanks,

Re: [rspec-users] newbie: how to preserve NoMethodError under stubbing?

2010-07-24 Thread David Chelimsky
On Fri, Jul 23, 2010 at 6:46 PM, Lille lille.pengu...@gmail.com wrote: Hi, I've been browsing the RSpec book and the RDoc, but I can't see how to ensure the following: Stub an instance with a method it doesn't have and raise NoMethodError (or something like it.) RSpec doesn't support

Re: [rspec-users] [Rails] Stubbed static methods are bleeding over into other specs and making them fail

2010-07-24 Thread David Chelimsky
On Fri, Jul 23, 2010 at 7:29 PM, Patrick Gannon patgan...@gmail.com wrote: I just got a chance to try this, and ran into more problems.  Prior to trying this, we were running RSpec2 beta 13.  When I changed our Gemfile to depend on 'edge' RSpec et al (as you suggested above), I get a very

Re: [rspec-users] newbie: how to preserve NoMethodError under stubbing?

2010-07-24 Thread Matt Wynne
Lille, On Sat, 24 Jul 2010 01:26 -0500, David Chelimsky dchelim...@gmail.com wrote: On Fri, Jul 23, 2010 at 6:46 PM, Lille lille.pengu...@gmail.com wrote: Hi, I've been browsing the RSpec book and the RDoc, but I can't see how to ensure the following: Stub an instance with a method

Re: [rspec-users] newbie: how to preserve NoMethodError under stubbing?

2010-07-24 Thread Wincent Colaiuta
El 24/07/2010, a las 08:26, David Chelimsky escribió: On Fri, Jul 23, 2010 at 6:46 PM, Lille lille.pengu...@gmail.com wrote: Hi, I've been browsing the RSpec book and the RDoc, but I can't see how to ensure the following: Stub an instance with a method it doesn't have and raise

Re: [rspec-users] newbie: how to preserve NoMethodError under stubbing?

2010-07-24 Thread David Chelimsky
On Jul 24, 2010, at 4:35 AM, Wincent Colaiuta wrote: El 24/07/2010, a las 08:26, David Chelimsky escribió: On Fri, Jul 23, 2010 at 6:46 PM, Lille lille.pengu...@gmail.com wrote: Hi, I've been browsing the RSpec book and the RDoc, but I can't see how to ensure the following: Stub an

Re: [rspec-users] newbie: how to preserve NoMethodError under stubbing?

2010-07-24 Thread Lille
David, Yes, your reading of the request is what I originally meant. I appreciate the points made by others in this thread and the thread David has referred to. As I continue to learn RSpec I will undoubtedly avail myself of the approaches recommended above or in the linked thread, but I think

Re: [rspec-users] newbie: how to preserve NoMethodError under stubbing?

2010-07-24 Thread Wincent Colaiuta
El 24/07/2010, a las 15:34, Lille escribió: David, Yes, your reading of the request is what I originally meant. I appreciate the points made by others in this thread and the thread David has referred to. As I continue to learn RSpec I will undoubtedly avail myself of the approaches

[rspec-users] Controller stub and helper spec with lastest beta

2010-07-24 Thread chatgris
Hello, I have two issues with beta 2.0.0.beta.18. First, here's the gems : gem rails, 3.0.0.beta4 gem mongoid, 2.0.0.beta10 group :test do gem rspec-rails, 2.0.0.beta.18 gem factory_girl_rails, 1.0 end My spec_helper : http://github.com/chatgris/blabbr/blob/spec/spec/spec_helper.rb First

Re: [rspec-users] Controller stub and helper spec with lastest beta

2010-07-24 Thread David Chelimsky
On Jul 24, 2010, at 9:33 AM, chatgris wrote: Hello, I have two issues with beta 2.0.0.beta.18. First, here's the gems : gem rails, 3.0.0.beta4 gem mongoid, 2.0.0.beta10 group :test do gem rspec-rails, 2.0.0.beta.18 gem factory_girl_rails, 1.0 end My spec_helper :

Re: [rspec-users] Controller stub and helper spec with lastest beta

2010-07-24 Thread Wincent Colaiuta
El 24/07/2010, a las 16:33, chatgris escribió: I have two issues with beta 2.0.0.beta.18. First, here's the gems : gem rails, 3.0.0.beta4 gem mongoid, 2.0.0.beta10 group :test do gem rspec-rails, 2.0.0.beta.18 gem factory_girl_rails, 1.0 end [snip] That gives this error :

Re: [rspec-users] newbie: how to preserve NoMethodError under stubbing?

2010-07-24 Thread Ashley Moran
On 24 Jul 2010, at 2:52 PM, Wincent Colaiuta wrote: How about this: f.stub.existing(:bar) That's probably RR influencing me there, which employs things like stub.proxy and so on. So maybe not such a good idea for rspec-mocks. Another option might be to deprecate #stub! as an alias for

Re: [rspec-users] How it would be tested?

2010-07-24 Thread Costa Shapiro
Alright, as far as I know, the most common approach is to make up some data for each controller spec, and one of the techniques for doing this is fixtures (e.g. found in rails) -- another is the mocks, of course. Fixtures aren't exactly the hottest offer today, but to me, they are probably the