Class: RSpec::Mocks::ArgumentMatchers::DuckTypeMatcher
- Inherits:
-
Object
- Object
- RSpec::Mocks::ArgumentMatchers::DuckTypeMatcher
- Defined in:
- lib/rspec/mocks/argument_matchers.rb
Instance Method Summary collapse
- #==(value) ⇒ 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.
87 88 89 |
# File 'lib/rspec/mocks/argument_matchers.rb', line 87 def initialize(*methods_to_respond_to) @methods_to_respond_to = methods_to_respond_to end |
Instance Method Details
#==(value) ⇒ Object
91 92 93 |
# File 'lib/rspec/mocks/argument_matchers.rb', line 91 def ==(value) @methods_to_respond_to.all? {|| value.respond_to?()} end |