class Shoulda::Matchers::Independent::DelegateMethodMatcher::StubbedTarget

@private

Attributes

received_arguments[R]
received_method[R]

Public Class Methods

new(method) click to toggle source
# File lib/shoulda/matchers/independent/delegate_method_matcher/stubbed_target.rb, line 7
def initialize(method)
  @received_method = false
  @received_arguments = []
  stub_method(method)
end

Public Instance Methods

has_received_arguments?(*args) click to toggle source
# File lib/shoulda/matchers/independent/delegate_method_matcher/stubbed_target.rb, line 17
def has_received_arguments?(*args)
  args == received_arguments
end
has_received_method?() click to toggle source
# File lib/shoulda/matchers/independent/delegate_method_matcher/stubbed_target.rb, line 13
def has_received_method?
  received_method
end

Protected Instance Methods

stub_method(method) click to toggle source
# File lib/shoulda/matchers/independent/delegate_method_matcher/stubbed_target.rb, line 23
def stub_method(method)
  class_eval do
    define_method method do |*args|
      @received_method = true
      @received_arguments = args
    end
  end
end