Class | RSpec::Mocks::BaseExpectation |
In: |
lib/rspec/mocks/message_expectation.rb
|
Parent: | Object |
error_generator | [RW] | |
expected_from | [W] | |
expected_received_count | [W] | |
method_block | [W] | |
sym | [R] |
Tells the mock or stub to raise an exception when the message is received.
When you pass an exception class, the MessageExpectation will raise an instance of it, creating it with new. If the exception class initializer requires any parameters, you must pass in an instance and not the class.
and_raise() and_raise(Exception) #any exception class and_raise(exception) #any exception object