class Missingly::ArrayDelegateMatcher

Attributes

array[R]
delegate_name[R]
options[R]

Public Class Methods

new(array, options, delegate_name) click to toggle source
# File lib/missingly/array_delegate_matcher.rb, line 5
def initialize(array, options, delegate_name)
  @array, @options, @delegate_name = array, options, delegate_name
end

Public Instance Methods

matchable() click to toggle source
# File lib/missingly/array_delegate_matcher.rb, line 15
def matchable; array; end
should_respond_to?(instance, name) click to toggle source
# File lib/missingly/array_delegate_matcher.rb, line 9
def should_respond_to?(instance, name)
  included_in_array = array.include?(name)
  delegate_responds_to = instance.send(delegate_name).respond_to?(name)
  included_in_array && delegate_responds_to
end