Re: [rspec-users] stub and should_receive

2010-03-02 Thread Phillip Koebbe
Nevermind. If I would have waited five more minutes before clicking "Send", I would have seen my error. Blech. Phillip Koebbe wrote: What is the expected behavior when a model has both stub and should_receive defined for the same method? I have a helper method which creates an admin "logged

[rspec-users] stub and should_receive

2010-03-02 Thread Phillip Koebbe
What is the expected behavior when a model has both stub and should_receive defined for the same method? I have a helper method which creates an admin "logged in": def stub_user(is_administrator) user = stub_model(User) user.stub(:is_administrator).and_return(is_administrator) User.

Re: [rspec-users] #stub! and #should_receive on the same method

2008-09-25 Thread David Chelimsky
On Thu, Sep 25, 2008 at 1:34 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > On 2008-09-25, at 14:04, David Chelimsky wrote: >> >> On Thu, Sep 25, 2008 at 12:47 PM, Nick Hoffman <[EMAIL PROTECTED]> >> wrote: >>> >>> I'm calling #stub! and #should_receive on the same method within a class, >>> and am

Re: [rspec-users] #stub! and #should_receive on the same method

2008-09-25 Thread Nick Hoffman
On 2008-09-25, at 14:04, David Chelimsky wrote: On Thu, Sep 25, 2008 at 12:47 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: I'm calling #stub! and #should_receive on the same method within a class, and am finding that the method doesn't return the value given to #stub! 216 it 'should mak

Re: [rspec-users] #stub! and #should_receive on the same method

2008-09-25 Thread Tero Tilus
2008-09-25 14:04, Nick Hoffman: > I knew there was a dead simple answer to the question. Thanks, Tero. > Apologies for the brain fart. Np. Done the same quite a few times myself. ;) -- Tero Tilus ## 050 3635 235 ## http://www.tilus.net/koti/tero/ ___

Re: [rspec-users] #stub! and #should_receive on the same method

2008-09-25 Thread David Chelimsky
On Thu, Sep 25, 2008 at 1:04 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > On 2008-09-25, at 13:58, Tero Tilus wrote: >> >> 2008-09-25 13:47, Nick Hoffman: >>> >>> I'm calling #stub! and #should_receive on the same method within a >>> class, and am finding that the method doesn't return the value g

Re: [rspec-users] #stub! and #should_receive on the same method

2008-09-25 Thread David Chelimsky
On Thu, Sep 25, 2008 at 12:47 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > I'm calling #stub! and #should_receive on the same method within a class, > and am finding that the method doesn't return the value given to #stub! > > 216 it 'should make a map marker' do > 217 mock_property = mo

Re: [rspec-users] #stub! and #should_receive on the same method

2008-09-25 Thread Nick Hoffman
On 2008-09-25, at 13:58, Tero Tilus wrote: 2008-09-25 13:47, Nick Hoffman: I'm calling #stub! and #should_receive on the same method within a class, and am finding that the method doesn't return the value given to #stub! How about GMarker.should_receive(:new).with(foo).and_return mock_marker

Re: [rspec-users] #stub! and #should_receive on the same method

2008-09-25 Thread Tero Tilus
2008-09-25 13:47, Nick Hoffman: > I'm calling #stub! and #should_receive on the same method within a > class, and am finding that the method doesn't return the value given > to #stub! How about GMarker.should_receive(:new).with(foo).and_return mock_marker -- Tero Tilus ## 050 3635 235 ## htt

[rspec-users] #stub! and #should_receive on the same method

2008-09-25 Thread Nick Hoffman
I'm calling #stub! and #should_receive on the same method within a class, and am finding that the method doesn't return the value given to #stub! 216 it 'should make a map marker' do 217 mock_property = mock 'property', 218 :address => '400 Bloor Street', 219 :title