rspec/rspec-mocks — pull request #121 by maeve (2012-03-28 00:42:41+00:00)
Title: and_raise should support intentionally raising an ArgumentError

Prior to rspec-mocks 2.9.0, a trivial test like this would pass:

```ruby
it "should raise an ArgumentError" do
error = ArgumentError.new("error message")
@mock.should_receive(:something).and_raise(error)
lambda {
@mock.something
}.should raise_error(ArgumentError, "error message")
end
```

As of 2.9.0, this now fails with the rather cryptic message:

```
expected ArgumentError with "error message", got #>
```

This appears to be a side effect of changes to introduce a friendlier error message when and_raise is called with an Exception class that doesn't have a zero-arg constructor. This fix explicitly checks for that case instead of trying to rescue all ArgumentErrors.