[rspec-users] MockExpectationError

Mark Wilden mark at mwilden.com
Sat Dec 6 01:21:32 EST 2008


On Fri, Dec 5, 2008 at 9:18 PM, Song Lee <lists at ruby-forum.com> wrote:


>    Profile.stub!(:new).and_return(@profile = mock_model(Profile))
>
> (rdb:1) @profile.user = 3
> Spec::Mocks::MockExpectationError Exception: Mock 'Profile_1300'
> received unexpected message :user= with (3)
>

You're stubbing :user when you need to stub :user=

///ark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081205/d48b6694/attachment.html>


More information about the rspec-users mailing list