Class: Mocha::ParameterMatchers::Includes
- Defined in:
- lib/mocha/parameter_matchers/includes.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(item) ⇒ Includes
constructor
A new instance of Includes.
- #matches?(available_parameters) ⇒ Boolean
- #mocha_inspect ⇒ Object
Methods inherited from Base
#&, #to_matcher, #|
Constructor Details
#initialize(item) ⇒ Includes
Returns a new instance of Includes.
23 24 25 |
# File 'lib/mocha/parameter_matchers/includes.rb', line 23 def initialize(item) @item = item end |
Instance Method Details
#matches?(available_parameters) ⇒ Boolean
27 28 29 30 31 |
# File 'lib/mocha/parameter_matchers/includes.rb', line 27 def matches?(available_parameters) parameter = available_parameters.shift return false unless parameter.respond_to?(:include?) return parameter.include?(@item) end |
#mocha_inspect ⇒ Object
33 34 35 |
# File 'lib/mocha/parameter_matchers/includes.rb', line 33 def mocha_inspect "includes(#{@item.mocha_inspect})" end |