Sha256: e74b1d435aff6f1769529429eef5815cd884d241cf352d6f4ddc5d8c0ee7ad9e

Contents?: true

Size: 948 Bytes

Versions: 45

Compression:

Stored size: 948 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

45 entries across 45 versions & 3 rubygems

Version Path
spicycode-micronaut-0.1.8.0 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.8.1 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.8.2 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.8.3 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.8.5 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.9.0 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.2.0.0 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.2.1.0 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.2.1.1 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.2.1.2 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.2.1.3 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.2.1.4 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.2.1.5 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.2.1.6 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.2.10 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.2.2 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.2.3 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.2.4 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.2.5 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.2.7 lib/micronaut/matchers/equal.rb