Method: Mocha::Expectation#raises
- Defined in:
- lib/mocha/expectation.rb
#raises ⇒ Expectation #raises(exception) ⇒ Expectation #raises(exception, message) ⇒ Expectation
Modifies expectation so that when the expected method is called, it raises the specified exception
with the specified message
i.e. calls Kernel#raise(exception, message).
483 484 485 486 |
# File 'lib/mocha/expectation.rb', line 483 def raises(exception = RuntimeError, = nil) @return_values += ReturnValues.new(ExceptionRaiser.new(exception, )) self end |