Class: Matchi::BeInstanceOf
- Inherits:
- BasicObject
- Defined in:
- lib/matchi/rspec/be_instance_of.rb
Overview
Type/class matcher.
Instance Method Summary collapse
-
#initialize(expected) ⇒ BeInstanceOf
constructor
Initialize the matcher with an object.
-
#matches? ⇒ Boolean
Comparison between actual and expected values.
Constructor Details
#initialize(expected) ⇒ BeInstanceOf
Initialize the matcher with an object.
11 12 13 |
# File 'lib/matchi/rspec/be_instance_of.rb', line 11 def initialize(expected) @expected = expected end |
Instance Method Details
#matches? ⇒ Boolean
Returns Comparison between actual and expected values.
23 24 25 |
# File 'lib/matchi/rspec/be_instance_of.rb', line 23 def matches? yield.instance_of?(@expected) end |