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-3.0.0.beta.7 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.0.0.beta.6 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.0.0.beta.5 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.0.0.beta.4 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.0.0.beta.3 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.0.0.beta.2 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-3.0.0.beta.1 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-2.4.1 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-2.4.1.beta.1 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-2.4.0 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-2.4.0.beta.2 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-2.4.0.beta.1 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-2.3.2 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-2.3.2.beta.2 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-2.3.2.beta.1 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-2.3.1 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-2.3.1.beta.1 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-2.3.0 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-2.3.0.beta.3 lib/extensions/mspec/mspec/matchers/equal.rb
rhodes-2.3.0.beta.2 lib/extensions/mspec/mspec/matchers/equal.rb