Class: Matchi::BeAnInstanceOf

Inherits:
BeInstanceOf show all
Defined in:
lib/matchi/rspec/be_an_instance_of.rb

Overview

Type/class matcher.

Instance Method Summary collapse

Methods inherited from BeInstanceOf

#initialize, #matches?

Constructor Details

This class inherits a constructor from Matchi::BeInstanceOf

Instance Method Details

#to_hHash

Returns a hash of one key-value pair with a key corresponding to the

matcher and a value corresponding to its initialize parameters.

Returns:

  • (Hash)

    A hash of one key-value pair.



18
19
20
# File 'lib/matchi/rspec/be_an_instance_of.rb', line 18

def to_h
  { BeAnInstanceOf: [@expected] }
end

#to_sString

Returns a string representing the matcher.

Returns:

  • (String)

    A string representing the matcher.



10
11
12
# File 'lib/matchi/rspec/be_an_instance_of.rb', line 10

def to_s
  "be_an_instance_of #{@expected.inspect}"
end