Re: [rspec-users] [RSpec] #and_raise

2009-02-18 Thread Nick Hoffman
On 16/02/2009, at 4:12 PM, David Chelimsky wrote: On Mon, Feb 16, 2009 at 1:48 PM, Nick Hoffman wrote: 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 Argum

Re: [rspec-users] [RSpec] #and_raise

2009-02-16 Thread David Chelimsky
On Mon, Feb 16, 2009 at 1:48 PM, Nick Hoffman wrote: > 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

[rspec-users] [RSpec] #and_raise

2009-02-16 Thread Nick Hoffman
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 th