Module: RR::StubProbeCreator::InstanceMethods
- Defined in:
- lib/rr/stub_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 34 35 36 37 38 39 |
# File 'lib/rr/stub_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.implemented_by(double.original_method) scenario.any_number_of_times if args.empty? scenario.with_any_args else scenario.with(*args) end scenario.after_call(&after_call) if after_call scenario end |