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
- #target readonly Internal use only
Instance Method Summary
- #define_matcher(matcher, name, &block) private Internal use only
- #matcher_allowed?(matcher) ⇒ Boolean private Internal use only
- #raise_negation_unsupported(method_name, matcher) private Internal use only
- #raise_unsupported_matcher(method_name, matcher) private Internal use only
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)
#raise_negation_unsupported(method_name, matcher) (private)
# 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)
# 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