Class: RSpec::Expectations::LegacyMatcherAdapter
- Inherits:
-
Matchers::MatcherDelegator
- Object
- Matchers::MatcherDelegator
- RSpec::Expectations::LegacyMatcherAdapter
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/handler.rb
Overview
Wraps a matcher written against one of the legacy protocols in order to present the current protocol.
Defined Under Namespace
Instance Attribute Summary
Attributes inherited from Matchers::MatcherDelegator
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(matcher) ⇒ LegacyMatcherAdapter
constructor
A new instance of LegacyMatcherAdapter.
Methods inherited from Matchers::MatcherDelegator
#initialize_copy, #method_missing, #respond_to?, #respond_to_missing?
Methods included from Matchers::Composable
#===, #and, #description_of, #or, should_enumerate?, surface_descriptions_in, unreadable_io?, #values_match?
Constructor Details
#initialize(matcher) ⇒ LegacyMatcherAdapter
Returns a new instance of LegacyMatcherAdapter.
114 115 116 117 118 119 120 121 122 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/handler.rb', line 114 def initialize(matcher) super ::RSpec.warn_deprecation(" |\#{matcher.class.name || matcher.inspect} implements a legacy RSpec matcher\n |protocol. For the current protocol you should expose the failure messages\n |via the `failure_message` and `failure_message_when_negated` methods.\n |(Used from \#{CallerFilter.first_non_rspec_line})\n EOS\nend\n".gsub(/^\s+\|/, ''), :type => "legacy_matcher") |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class RSpec::Matchers::MatcherDelegator
Class Method Details
.wrap(matcher) ⇒ Object
124 125 126 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/handler.rb', line 124 def self.wrap(matcher) new(matcher) if interface_matches?(matcher) end |