123456789_123456789_123456789_123456789_123456789_

Module: RSpec::Mocks::TargetDelegationInstanceMethods Private

Do not use. This module is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: rspec-mocks/lib/rspec/mocks/targets.rb

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#target (readonly)

[ GitHub ]

  
# File 'rspec-mocks/lib/rspec/mocks/targets.rb', line 37

attr_reader :target

Instance Method Details

#define_matcher(matcher, name, &block) (private)

[ GitHub ]

  
# File 'rspec-mocks/lib/rspec/mocks/targets.rb', line 45

def define_matcher(matcher, name, &block)
  matcher.__send__(name, target, &block)
end

#matcher_allowed?(matcher) ⇒ Boolean (private)

[ GitHub ]

  
# File 'rspec-mocks/lib/rspec/mocks/targets.rb', line 41

def matcher_allowed?(matcher)
  Matchers::Matcher === matcher
end

#raise_negation_unsupported(method_name, matcher) (private)

[ GitHub ]

  
# File 'rspec-mocks/lib/rspec/mocks/targets.rb', line 55

def raise_negation_unsupported(method_name, matcher)
  raise NegationUnsupportedError,
        "`#{expression}(...).#{method_name} #{matcher.matcher_name}` is not supported since it " \
        "doesn't really make sense. What would it even mean?"
end

#raise_unsupported_matcher(method_name, matcher) (private)

[ GitHub ]

  
# File 'rspec-mocks/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