Module: RR::DoNotAllowCreator::InstanceMethods

Defined in:
lib/rr/do_not_allow_creator.rb

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/rr/do_not_allow_creator.rb', line 20

def method_missing(method_name, *args, &returns)
  double = @space.create_double(@subject, method_name)
  scenario = @space.create_scenario(double)
  if args.empty?
    scenario.with_any_args
  else
    scenario.with(*args)
  end
  scenario.never.returns(&returns)
  scenario
end