Class: RSpec::Mocks::ArgumentMatchers::DuckTypeMatcher
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-mocks-3.12.2/lib/rspec/mocks/argument_matchers.rb
Instance Method Summary collapse
- #===(value) ⇒ Object
- #description ⇒ Object
-
#initialize(*methods_to_respond_to) ⇒ DuckTypeMatcher
constructor
A new instance of DuckTypeMatcher.
Constructor Details
#initialize(*methods_to_respond_to) ⇒ DuckTypeMatcher
Returns a new instance of DuckTypeMatcher.
263 264 265 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-mocks-3.12.2/lib/rspec/mocks/argument_matchers.rb', line 263 def initialize(*methods_to_respond_to) @methods_to_respond_to = methods_to_respond_to end |
Instance Method Details
#===(value) ⇒ Object
267 268 269 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-mocks-3.12.2/lib/rspec/mocks/argument_matchers.rb', line 267 def ===(value) @methods_to_respond_to.all? { || value.respond_to?() } end |
#description ⇒ Object
271 272 273 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-mocks-3.12.2/lib/rspec/mocks/argument_matchers.rb', line 271 def description "duck_type(#{@methods_to_respond_to.map(&:inspect).join(', ')})" end |