Class: Crspec::Matchers::BeAnInstanceOfMatcher
Instance Attribute Summary
Attributes inherited from BaseMatcher
#actual, #expected
Instance Method Summary
collapse
Methods inherited from BaseMatcher
#and, #initialize, #or
Instance Method Details
#failure_message ⇒ Object
161
162
163
|
# File 'lib/crspec/matchers.rb', line 161
def failure_message
"Expected #{@actual.inspect} to be an instance of #{@expected}, but was #{@actual.class}"
end
|
#failure_message_when_negated ⇒ Object
165
166
167
|
# File 'lib/crspec/matchers.rb', line 165
def failure_message_when_negated
"Expected #{@actual.inspect} not to be an instance of #{@expected}"
end
|
#matches?(actual) ⇒ Boolean
156
157
158
159
|
# File 'lib/crspec/matchers.rb', line 156
def matches?(actual)
@actual = actual
@actual.instance_of?(@expected)
end
|