Class RSpec::Mocks::BaseExpectation
In: lib/rspec/mocks/message_expectation.rb
Parent: Object

Methods

Attributes

error_generator  [RW] 
expected_from  [W] 
expected_received_count  [W] 
method_block  [W] 
sym  [R] 

Public Class methods

Public Instance methods

Tells the mock or stub to raise an exception when the message is received.

Warning

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.

Examples

  and_raise()
  and_raise(Exception) #any exception class
  and_raise(exception) #any exception object

Protected Instance methods

[Validate]