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
mspec-1.7.0 lib/mspec/matchers/equal.rb
mspec-1.6.0 lib/mspec/matchers/equal.rb
mspec-1.5.21 lib/mspec/matchers/equal.rb
mspec-1.5.20 lib/mspec/matchers/equal.rb
mspec-1.5.19 lib/mspec/matchers/equal.rb
mspec-1.5.18 lib/mspec/matchers/equal.rb
rhodes-3.5.1.12 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.3.5 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.4.2 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.3.4 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.3.3 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.3.3.beta.4 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.3.3.beta.3 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.3.3.beta.2 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.3.3.beta.1 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.3.2 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.3.2.beta.7 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.3.2.beta.6 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.3.2.beta.5 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.3.2.beta.4 lib/extensions/mspec/mspec/matchers/equal.rb