On 2008-11-05, at 14:55, Fernando Perez wrote:
And I get the following error message:
--
Mock 'Order_1' received unexpected message :amount= with (50)
--


Well I know that @cart.amount will be set to 50, but why is RSpec
complaining about that?

If I put @cart.should_receive(:amount).with(50), rspec still throws an
error message. What to do?

Hi Fernando. The error's occuring because #amount= hasn't been defined within the "Order_1" mock object. Try this:
  @cart.should_receive(:amount=).with 50

Cheers,
Nick

_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to