Class: RSpec::Mocks::AnyInstance::FluentInterfaceProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/mocks/any_instance/proxy.rb

Overview

Delegates messages to each of the given targets in order to provide the fluent interface that is available off of message expectations when dealing with any_instance.

targets will typically contain 1 of the AnyInstance::Recorder return values and N MessageExpectation instances (one per instance of the any_instance klass).

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, &block) ⇒ Object



109
110
111
112
# File 'lib/rspec/mocks/any_instance/proxy.rb', line 109

def method_missing(*args, &block)
  return_values = @targets.map { |t| t.__send__(*args, &block) }
  FluentInterfaceProxy.new(return_values)
end