Class: Spec::Mocks::DuckTypeArgConstraint
- Defined in:
- lib/spec/mocks/argument_expectation.rb
Instance Method Summary collapse
-
#initialize(*methods_to_respond_do) ⇒ DuckTypeArgConstraint
constructor
A new instance of DuckTypeArgConstraint.
- #matches?(value) ⇒ Boolean
Constructor Details
#initialize(*methods_to_respond_do) ⇒ DuckTypeArgConstraint
Returns a new instance of DuckTypeArgConstraint.
74 75 76 |
# File 'lib/spec/mocks/argument_expectation.rb', line 74 def initialize(*methods_to_respond_do) @methods_to_respond_do = methods_to_respond_do end |
Instance Method Details
#matches?(value) ⇒ Boolean
78 79 80 |
# File 'lib/spec/mocks/argument_expectation.rb', line 78 def matches?(value) @methods_to_respond_do.all? { |sym| value.respond_to?(sym) } end |