module RSpec::Mocks::TargetDelegationInstanceMethods

@private

Attributes

target[R]

Private Instance Methods

define_matcher(matcher, name, &block) click to toggle source
# File lib/rspec/mocks/targets.rb, line 45
def define_matcher(matcher, name, &block)
  matcher.__send__(name, target, &block)
end
matcher_allowed?(matcher) click to toggle source
# File lib/rspec/mocks/targets.rb, line 41
def matcher_allowed?(matcher)
  Matchers::Matcher === matcher
end
raise_negation_unsupported(method_name, matcher) click to toggle source
# File lib/rspec/mocks/targets.rb, line 55
def raise_negation_unsupported(method_name, matcher)
  raise NegationUnsupportedError,
        "`#{expression}(...).#{method_name} #{matcher.name}` is not supported since it "                "doesn't really make sense. What would it even mean?"
end
raise_unsupported_matcher(method_name, matcher) click to toggle source
# File lib/rspec/mocks/targets.rb, line 49
def raise_unsupported_matcher(method_name, matcher)
  raise UnsupportedMatcherError,
        "only the `receive`, `have_received` and `receive_messages` matchers are supported "                "with `#{expression}(...).#{method_name}`, but you have provided: #{matcher}"
end