[rspec-users] stub vs stub!

2010-03-19 Thread Nick Hoffman
RSpec's changelog says that in version 1.2.5: "also alias_method :stub, :stub!, so you can stub with less bang" which I've been taking advantage of a lot. However, I just ran into a situation where using #stub caused an error to occur, and changing to #stub! caused the error the disappear. Any

Re: [rspec-users] stub vs stub!

2010-03-19 Thread Pat Maddox
I've never heard of CurbFu, but according to http://github.com/gdi/curb-fu/blob/master/lib/curb-fu.rb#L43 it defines a stub method already. So you're hitting that one, which expects two arguments. stub! goes to RSpec's mocking framework. Pat On Mar 19, 2010, at 10:00 AM, Nick Hoffman wrote

Re: [rspec-users] stub vs stub!

2010-03-19 Thread Nick Hoffman
Pat Maddox wrote: > I've never heard of CurbFu, but according to > http://github.com/gdi/curb-fu/blob/master/lib/curb-fu.rb#L43 it defines > a stub method already. So you're hitting that one, which expects two > arguments. stub! goes to RSpec's mocking framework. > > Pat Good catch! Thanks,

Re: [rspec-users] stub vs stub!

2010-03-19 Thread David Chelimsky
On Mar 19, 2010, at 1:27 PM, Nick Hoffman wrote: > Pat Maddox wrote: >> I've never heard of CurbFu, but according to >> http://github.com/gdi/curb-fu/blob/master/lib/curb-fu.rb#L43 it defines >> a stub method already. So you're hitting that one, which expects two >> arguments. stub! goes to R

[rspec-users] lots of nil problems!

2010-03-19 Thread Patrick J. Collins
Hi, I have this in my controller action: from_address = Setting.find_by_name("shipping_from_address").address and my spec fails: NoMethodError in 'Admin::ShippingLabelsController should render a pdf file' undefined method `address' for nil:NilClass yet in the console I can do: >> Setting.fin

Re: [rspec-users] lots of nil problems!

2010-03-19 Thread Nick Hoffman
Patrick Collins wrote: > Hi, > > I have this in my controller action: > > from_address = Setting.find_by_name("shipping_from_address").address > > and my spec fails: > > NoMethodError in 'Admin::ShippingLabelsController should render a pdf > file' > undefined method `address' for nil:NilClass

Re: [rspec-users] lots of nil problems!

2010-03-19 Thread patrick99e99
> Patrick, please create a new thread for this, since it doesn't have > anything to do with the current topic. Wow that is weird.. I replied to the previous thread in my email client but removed the subject-- as I assumed that was what kept things associated with threads; there was no other text

[rspec-users] lots of nil problems!

2010-03-19 Thread patrick99e99
Hi, I have this in my controller action: from_address = Setting.find_by_name("shipping_from_address").address and my spec fails: NoMethodError in 'Admin::ShippingLabelsController should render a pdf file' undefined method `address' for nil:NilClass yet in the console I can do: >> Setting.fin

Re: [rspec-users] lots of nil problems!

2010-03-19 Thread Nick Hoffman
patrick99e99 wrote: >> Patrick, please create a new thread for this, since it doesn't have >> anything to do with the current topic. > > Wow that is weird.. I replied to the previous thread in my email > client but removed the subject-- as I assumed that was what kept > things associated with thr

Re: [rspec-users] lots of nil problems!

2010-03-19 Thread Nick Hoffman
Hey Patrick. > I have this in my controller action: > > from_address = Setting.find_by_name("shipping_from_address").address > > and my spec fails: > > NoMethodError in 'Admin::ShippingLabelsController should render a pdf > file' > undefined method `address' for nil:NilClass > > yet in the con