Class: RSpec::Given::Failure
- Inherits:
- BasicObject
- Defined in:
- lib/rspec/given/failure.rb
Overview
Failure objects will raise the given exception whenever you try to send it any message.
Instance Method Summary collapse
-
#initialize(exception) ⇒ Failure
constructor
A new instance of Failure.
- #method_missing(sym, *args, &block) ⇒ Object
Constructor Details
#initialize(exception) ⇒ Failure
Returns a new instance of Failure.
9 10 11 |
# File 'lib/rspec/given/failure.rb', line 9 def initialize(exception) @exception = exception end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object
13 14 15 |
# File 'lib/rspec/given/failure.rb', line 13 def method_missing(sym, *args, &block) ::Kernel.raise @exception end |