Class: Mocha::ParameterMatchers::IsA
- Defined in:
- lib/mocha/parameter_matchers/is_a.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(klass) ⇒ IsA
constructor
A new instance of IsA.
- #matches?(available_parameters) ⇒ Boolean
- #mocha_inspect ⇒ Object
Methods inherited from Base
#&, #to_matcher, #|
Constructor Details
#initialize(klass) ⇒ IsA
Returns a new instance of IsA.
25 26 27 |
# File 'lib/mocha/parameter_matchers/is_a.rb', line 25 def initialize(klass) @klass = klass end |
Instance Method Details
#matches?(available_parameters) ⇒ Boolean
29 30 31 32 |
# File 'lib/mocha/parameter_matchers/is_a.rb', line 29 def matches?(available_parameters) parameter = available_parameters.shift parameter.is_a?(@klass) end |
#mocha_inspect ⇒ Object
34 35 36 |
# File 'lib/mocha/parameter_matchers/is_a.rb', line 34 def mocha_inspect "is_a(#{@klass.mocha_inspect})" end |