Class: RSpec::Matchers::MatcherDelegator Private
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
RSpec::Expectations::LegacyMatcherAdapter, RSpec::Matchers::AliasedMatcher, RSpec::Matchers::AliasedMatcherWithOperatorSupport, RSpec::Matchers::AliasedNegatedMatcher, RSpec::Expectations::LegacyMatcherAdapter::RSpec1, RSpec::Expectations::LegacyMatcherAdapter::RSpec2
|
|
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
BaseDelegator
|
|
Instance Chain:
self,
Composable ,
BaseDelegator
|
|
Inherits: |
RSpec::Matchers::BaseDelegator
|
Defined in: | rspec-expectations/lib/rspec/matchers/matcher_delegator.rb |
Overview
Provides the necessary plumbing to wrap a matcher with a decorator.
Class Method Summary
- .new(base_matcher) ⇒ MatcherDelegator constructor Internal use only
Instance Attribute Summary
- #base_matcher readonly Internal use only
Instance Method Summary
- #initialize_copy(other) Internal use only
- #method_missing(*args, &block) Internal use only
-
#respond_to?(name, include_all = false) ⇒ Boolean
Internal use only
:nocov:
- #respond_to_missing?(name, include_all = false) ⇒ Boolean Internal use only
Composable
- Included
#& | Alias for Composable#and. |
#=== | Delegates to |
#and | Creates a compound |
#description_of | Returns the description of the given object in a way that is aware of composed matchers. |
#or | Creates a compound |
#values_match? | This provides a generic way to fuzzy-match an expected value against an actual value. |
#| | Alias for Composable#or. |
#should_enumerate? | We should enumerate arrays as long as they are not recursive. |
#surface_descriptions_in | Transforms the given data structure (typically a hash or array) into a new data structure that, when |
#unreadable_io?, | |
#with_matchers_cloned | Historically, a single matcher instance was only checked against a single value. |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block)
[ GitHub ]# File 'rspec-expectations/lib/rspec/matchers/matcher_delegator.rb', line 39
def method_missing(*args, &block) base_matcher.__send__(*args, &block) end
Instance Attribute Details
#base_matcher (readonly)
[ GitHub ]# File 'rspec-expectations/lib/rspec/matchers/matcher_delegator.rb', line 33
attr_reader :base_matcher
Instance Method Details
#initialize_copy(other)
[ GitHub ]# File 'rspec-expectations/lib/rspec/matchers/matcher_delegator.rb', line 55
def initialize_copy(other) @base_matcher = @base_matcher.clone super end
#respond_to?(name, include_all = false) ⇒ Boolean
:nocov:
# File 'rspec-expectations/lib/rspec/matchers/matcher_delegator.rb', line 49
def respond_to?(name, include_all=false) super || base_matcher.respond_to?(name, include_all) end
#respond_to_missing?(name, include_all = false) ⇒ Boolean
# File 'rspec-expectations/lib/rspec/matchers/matcher_delegator.rb', line 44
def respond_to_missing?(name, include_all=false) super || base_matcher.respond_to?(name, include_all) end