Class: ThrowOnCall
- Inherits:
-
Object
- Object
- ThrowOnCall
- Defined in:
- lib/rspec/isolate/throw_on_call.rb
Instance Method Summary collapse
-
#initialize(klass) ⇒ ThrowOnCall
constructor
A new instance of ThrowOnCall.
- #method_missing(name, *args) ⇒ Object
Constructor Details
#initialize(klass) ⇒ ThrowOnCall
Returns a new instance of ThrowOnCall.
2 3 4 |
# File 'lib/rspec/isolate/throw_on_call.rb', line 2 def initialize(klass) @klass = klass end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
6 7 8 |
# File 'lib/rspec/isolate/throw_on_call.rb', line 6 def method_missing(name, *args) raise IsolationError.new("Method :#{name} called on isolated class #{@klass.name}") end |