Sha256: 3235b20bf84620778f7f04b19104443548c8c9b51eb04789839cf0c298cbf8db
Contents?: true
Size: 540 Bytes
Versions: 180
Compression:
Stored size: 540 Bytes
Contents
class BeAnInstanceOfMatcher def initialize(expected) @expected = expected end def matches?(actual) @actual = actual @actual.instance_of?(@expected) end def failure_message ["Expected #{@actual.inspect} (#{@actual.class})", "to be an instance of #{@expected}"] end def negative_failure_message ["Expected #{@actual.inspect} (#{@actual.class})", "not to be an instance of #{@expected}"] end end class Object def be_an_instance_of(expected) BeAnInstanceOfMatcher.new(expected) end end
Version data entries
180 entries across 156 versions & 4 rubygems