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 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 strange >> error wh

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" wrote: > On Fri, Jul 23, 2010 at 6:46 PM, Lille 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 NoMet

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

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 wrote: >>> Hi, >>> >>> I've been browsing the RSpec book and the RDoc, but I can't see how to >>> ensure the following: >>> >>> Stub an insta

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 an

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

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

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

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 gi

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 al

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 easi

Re: [rspec-users] rspec-orm and _not_ mocking models

2010-07-24 Thread Costa Shapiro
I'm sorry, I'd like to clarify my statement about the model, view and controller (spec) separation. From my perspective, model is an abstract definition which is a spec for itself; view interacts with controller under the model contract, and all the "model" code is actually low-level controller co