I often use #and_raise like so:
@error_message = 'Some error'
@sf.should_receive(:shift_time!).and_raise @error_message
However, after trying to do this:
@argument_error = mock_model ArgumentError,
:message => @error_message
@sf.should_receive(:shift_time!).and_raise @argument_error
and then reading the docs for #and_raise, I realised that #and_raise
only accepts a String or exception class.
Is there a way to set the exception class and error message?
-Nick
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users