Class: Crspec::Matchers::BeAKindOfMatcher

Inherits:
BaseMatcher
  • Object
show all
Defined in:
lib/crspec/matchers.rb

Instance Attribute Summary

Attributes inherited from BaseMatcher

#actual, #expected

Instance Method Summary collapse

Methods inherited from BaseMatcher

#and, #initialize, #or

Constructor Details

This class inherits a constructor from Crspec::Matchers::BaseMatcher

Instance Method Details

#failure_messageObject



146
147
148
# File 'lib/crspec/matchers.rb', line 146

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

#failure_message_when_negatedObject



150
151
152
# File 'lib/crspec/matchers.rb', line 150

def failure_message_when_negated
  "Expected #{@actual.inspect} not to be a kind of #{@expected}"
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


141
142
143
144
# File 'lib/crspec/matchers.rb', line 141

def matches?(actual)
  @actual = actual
  @actual.is_a?(@expected)
end