Class: ThrowOnCall

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/isolate/throw_on_call.rb

Instance Method Summary collapse

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

Raises:



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