Class: Spec::Mocks::ArgumentConstraints::DuckTypeConstraint
- Defined in:
- lib/gems/rspec-1.1.11/lib/spec/mocks/argument_constraints.rb
Instance Method Summary collapse
- #==(value) ⇒ Object
-
#initialize(*methods_to_respond_to) ⇒ DuckTypeConstraint
constructor
A new instance of DuckTypeConstraint.
Constructor Details
#initialize(*methods_to_respond_to) ⇒ DuckTypeConstraint
Returns a new instance of DuckTypeConstraint.
77 78 79 |
# File 'lib/gems/rspec-1.1.11/lib/spec/mocks/argument_constraints.rb', line 77 def initialize(*methods_to_respond_to) @methods_to_respond_to = methods_to_respond_to end |
Instance Method Details
#==(value) ⇒ Object
81 82 83 |
# File 'lib/gems/rspec-1.1.11/lib/spec/mocks/argument_constraints.rb', line 81 def ==(value) @methods_to_respond_to.all? { |sym| value.respond_to?(sym) } end |