Module: RR::MockProbeCreator::InstanceMethods

Defined in:
lib/rr/mock_probe_creator.rb

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &after_call) ⇒ Object (protected)



27
28
29
30
31
32
33
# File 'lib/rr/mock_probe_creator.rb', line 27

def method_missing(method_name, *args, &after_call)
  double = @space.create_double(@subject, method_name)
  scenario = @space.create_scenario(double)
  scenario.with(*args).once.implemented_by(double.original_method)
  scenario.after_call(&after_call) if after_call
  scenario
end