Sha256: d73d5b5f5c1e0712f59df70ef275d77f25fb24f368a27395fe0eeab718e7d266

Contents?: true

Size: 506 Bytes

Versions: 198

Compression:

Stored size: 506 Bytes

Contents

class EqualMatcher
  def initialize(expected)
    @expected = expected
  end

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

  def failure_message
    ["Expected #{@actual.pretty_inspect}",
     "to be identical to #{@expected.pretty_inspect}"]
  end

  def negative_failure_message
    ["Expected #{@actual.pretty_inspect}",
     "not to be identical to #{@expected.pretty_inspect}"]
  end
end

class Object
  def equal(expected)
    EqualMatcher.new(expected)
  end
end

Version data entries

198 entries across 174 versions & 4 rubygems

Version Path
rhodes-7.6.0 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-7.5.1 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-7.4.1 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-7.1.17 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-6.2.0 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-6.0.11 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-5.5.18 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-5.5.17 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-5.5.15 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-5.5.0.22 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-5.5.2 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-5.5.0.7 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-5.5.0.3 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-5.5.0 lib/extensions/mspec/mspec/matchers/equal.rb
tauplatform-1.0.3 lib/extensions/mspec/mspec/matchers/equal.rb
mspec-1.9.1 lib/mspec/matchers/equal.rb
mspec-1.9.0 lib/mspec/matchers/equal.rb
tauplatform-1.0.2 lib/extensions/mspec/mspec/matchers/equal.rb
tauplatform-1.0.1 lib/extensions/mspec/mspec/matchers/equal.rb
mspec-1.8.0 lib/mspec/matchers/equal.rb