class RSpec::Mocks::LiveMessageExpectation

Attributes

method_double[R]

Public Class Methods

new(method_double, *args, &block) click to toggle source
Calls superclass method
# File lib/rspec/mocks-call-through.rb, line 35
def initialize(method_double, *args, &block)
  @method_double = method_double
  super(*args, &block)
end

Public Instance Methods

and_call_through() click to toggle source
# File lib/rspec/mocks-call-through.rb, line 45
def and_call_through
  and_return { |*args|
    method_name = @method_double.obfuscate(@method_double.method_name)
    object = @method_double.object

    method = object.method(method_name)

    block = args.pop if args.last.kind_of?(Proc) && args.last.tainted?

    object.send(method_name, *args, &block)
  }
end
invoke_return_block(*args, &block) click to toggle source
Calls superclass method
# File lib/rspec/mocks-call-through.rb, line 40
def invoke_return_block(*args, &block)
  block.taint if block
  super(*args, &block)
end