Class: Matchy::Expectations::BeKindOfExpectation

Inherits:
Base
  • Object
show all
Defined in:
lib/matchy/built_in/truth_expectations.rb

Instance Method Summary collapse

Methods inherited from Base

#fail!, #initialize, #pass!

Constructor Details

This class inherits a constructor from Matchy::Expectations::Base

Instance Method Details

#failure_messageObject



25
26
27
# File 'lib/matchy/built_in/truth_expectations.rb', line 25

def failure_message
  "Expected #{@receiver.inspect} to be kind of #{@expected.inspect}."
end

#matches?(receiver) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
23
# File 'lib/matchy/built_in/truth_expectations.rb', line 20

def matches?(receiver)
  @receiver = receiver
  @receiver.kind_of?(@expected)
end

#negative_failure_messageObject



29
30
31
# File 'lib/matchy/built_in/truth_expectations.rb', line 29

def negative_failure_message
  "Expected #{@receiver.inspect} to not be kind of #{@expected.inspect}."
end