Class: Spec::Mocks::DuckTypeArgConstraint
- Defined in:
- lib/spec/mocks/argument_expectation.rb
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(*methods_to_respond_to) ⇒ DuckTypeArgConstraint
constructor
A new instance of DuckTypeArgConstraint.
- #matches?(value) ⇒ Boolean
Constructor Details
#initialize(*methods_to_respond_to) ⇒ DuckTypeArgConstraint
Returns a new instance of DuckTypeArgConstraint.
99 100 101 |
# File 'lib/spec/mocks/argument_expectation.rb', line 99 def initialize(*methods_to_respond_to) @methods_to_respond_to = methods_to_respond_to end |
Instance Method Details
#description ⇒ Object
107 108 109 |
# File 'lib/spec/mocks/argument_expectation.rb', line 107 def description "duck_type" end |
#matches?(value) ⇒ Boolean
103 104 105 |
# File 'lib/spec/mocks/argument_expectation.rb', line 103 def matches?(value) @methods_to_respond_to.all? { |sym| value.respond_to?(sym) } end |