Sha256: a6cc87ceaa5758f1a4da7f2c91e50bb7d718312f3621f728bd4abb92f2ef541d

Contents?: true

Size: 947 Bytes

Versions: 9

Compression:

Stored size: 947 Bytes

Contents

module Micronaut
  module Matchers
  
    # :call-seq:
    #   should equal(expected)
    #   should_not equal(expected)
    #
    # Passes if given and expected are the same object (object identity).
    #
    # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more information about equality in Ruby.
    #
    # == Examples
    #
    #   5.should equal(5) #Fixnums are equal
    #   "5".should_not equal("5") #Strings that look the same are not the same object
    def equal(expected)
      simple_matcher do |actual, matcher|
        matcher.failure_message          = "expected #{expected.inspect}, got #{actual.inspect} (using .equal?)", expected, actual
        matcher.negative_failure_message = "expected #{actual.inspect} not to equal #{expected.inspect} (using .equal?)", expected, actual
        matcher.description              = "equal #{expected.inspect}"
        actual.equal?(expected)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spicycode-micronaut-0.0.3 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.0.4 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.0.5 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.0.6 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.0.7 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.0.9 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.0 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.1 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.2 lib/micronaut/matchers/equal.rb