Sha256: d2614e4635457535891b6d652e8e16a279d6b576c6775171c9e9399652500f93

Contents?: true

Size: 700 Bytes

Versions: 4

Compression:

Stored size: 700 Bytes

Contents

require 'spec_helper'
module Alf
  describe Keys, "hash and ==" do

    subject{ left == right }

    after do
      (left.hash == right.hash).should be_true if subject
    end

    context 'on empty Keys' do
      let(:left) { Keys.new [] }
      let(:right){ Keys.new [] }

      it{ should be_true }
    end

    context 'on non-empty equal Keys' do
      let(:left) { Keys.new [ AttrList[], AttrList[:b, :a] ] }
      let(:right){ Keys.new [ AttrList[:a, :b], AttrList[] ] }

      it{ should be_true }
    end

    context 'on non equal Keys' do
      let(:left) { Keys.new [ AttrList[:b, :a] ] }
      let(:right){ Keys.new [ AttrList[:a, :c] ] }

      it{ should be_false }
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-types/keys/test_hash_and_equal.rb
alf-core-0.14.0 spec/unit/alf-types/keys/test_hash_and_equal.rb
alf-core-0.13.1 spec/unit/alf-types/keys/test_hash_and_equal.rb
alf-core-0.13.0 spec/unit/alf-types/keys/test_hash_and_equal.rb