Sha256: 95d73a2deb3225f8b1c633ecb3665c84c0a11ef12fe8f83ffb80a4088f4c65fa

Contents?: true

Size: 348 Bytes

Versions: 18

Compression:

Stored size: 348 Bytes

Contents

RSpec::Matchers.define(:be_hash_eql) do |othr|
  diffable
  match do |obj|
    if obj.respond_to?(:hash_eql?)
      obj.hash_eql?(othr)
    else
      # same = (obj.length == othr.length)
      same = true
      ( othr.each_pair{|k,v| same &&= (v == obj[k]) } &&
        obj .each_pair{|k,v| same &&= (v == othr[k]) })
      same
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
gorillib-0.6.0 spec/support/matchers/be_hash_eql.rb
gorillib-0.5.2 spec/support/matchers/be_hash_eql.rb
gorillib-0.5.0 spec/support/matchers/be_hash_eql.rb
gorillib-0.4.2 spec/support/matchers/be_hash_eql.rb
gorillib-0.4.2pre spec/support/matchers/be_hash_eql.rb
gorillib-0.4.0pre spec/support/matchers/be_hash_eql.rb
gorillib-0.4.1pre spec/support/matchers/be_hash_eql.rb
gorillib-0.1.11 spec/support/matchers/be_hash_eql.rb
gorillib-0.1.9 spec/support/matchers/be_hash_eql.rb
gorillib-0.1.8 spec/support/matchers/be_hash_eql.rb
gorillib-0.1.7 spec/support/matchers/be_hash_eql.rb
gorillib-0.1.6 spec/support/matchers/be_hash_eql.rb
gorillib-0.1.5 spec/support/matchers/be_hash_eql.rb
gorillib-0.1.4 spec/support/matchers/be_hash_eql.rb
gorillib-0.1.3 spec/support/matchers/be_hash_eql.rb
gorillib-0.1.2 spec/support/matchers/be_hash_eql.rb
gorillib-0.1.1 spec/support/matchers/be_hash_eql.rb
gorillib-0.1.0 spec/support/matchers/be_hash_eql.rb