class BeAnInstanceOfMatcher

Public Class Methods

new(expected) click to toggle source
# File lib/mspec/matchers/be_an_instance_of.rb, line 2
def initialize(expected)
  @expected = expected
end

Public Instance Methods

failure_message() click to toggle source
# File lib/mspec/matchers/be_an_instance_of.rb, line 11
def failure_message
  ["Expected #{@actual.inspect} (#{@actual.class})",
   "to be an instance of #{@expected}"]
end
matches?(actual) click to toggle source
# File lib/mspec/matchers/be_an_instance_of.rb, line 6
def matches?(actual)
  @actual = actual
  @actual.instance_of?(@expected)
end
negative_failure_message() click to toggle source
# File lib/mspec/matchers/be_an_instance_of.rb, line 16
def negative_failure_message
  ["Expected #{@actual.inspect} (#{@actual.class})",
   "not to be an instance of #{@expected}"]
end