Class: Spec::Api::DuckTypeArgConstraint
- Defined in:
- lib/spec/api/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.
53 54 55 |
# File 'lib/spec/api/mocks/argument_expectation.rb', line 53 def initialize(*methods_to_respond_do) @methods_to_respond_do = methods_to_respond_do end |
Instance Method Details
#matches?(value) ⇒ Boolean
57 58 59 |
# File 'lib/spec/api/mocks/argument_expectation.rb', line 57 def matches?(value) @methods_to_respond_do.all? { |sym| value.respond_to?(sym) } end |