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
rsanheim-micronaut-0.1.3.2 lib/micronaut/matchers/equal.rb
rsanheim-micronaut-0.1.4.1 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.3 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.4.1 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.4.2 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.4.3 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.4.4 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.4 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.5.2 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.5 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.6.1 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.6.8 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.6.9.1 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.6.9 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.6 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.7.1 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.7.2 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.7.3 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.7.4 lib/micronaut/matchers/equal.rb
spicycode-micronaut-0.1.7 lib/micronaut/matchers/equal.rb