Module: RSpec::Mocks::VerifyingDouble

Defined in:
lib/rspec/mocks/verifying_double.rb

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(message, *args, &block)



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/rspec/mocks/verifying_double.rb', line 21

def method_missing(message, *args, &block)
  # Null object conditional is an optimization. If not a null object,
  # validity of method expectations will have been checked at definition
  # time.
  if null_object?
    if @__sending_message == message
      __mock_proxy.ensure_implemented(message)
    else
      __mock_proxy.ensure_publicly_implemented(message, self)
    end
  end

  super
end