Module: RR::MockCreator::InstanceMethods

Defined in:
lib/rr/mock_creator.rb

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



18
19
20
21
22
23
# File 'lib/rr/mock_creator.rb', line 18

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