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

Version Path
rhodes-3.3.2.beta.3 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.3.2.beta.2 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.3.2.beta.1 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.3.1 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.3.0 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.3.0.beta.3 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.3.0.beta.2 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.3.0.beta.1 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.2.3 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.2.2 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.2.2.beta lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.2.1 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.2.0 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.2.0.beta.9 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.2.0.beta.8 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.2.0.beta.7 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.2.0.beta.6 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.2.0.beta.5 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.2.0.beta.4 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb
rhodes-3.2.0.beta.2 lib/extensions/mspec/mspec/matchers/be_an_instance_of.rb