Sha256: a3b1e84bba0ab34303ffbff0532e1faea8606eceeaab3c9faf6bbe1d45acef24

Contents?: true

Size: 536 Bytes

Versions: 3

Compression:

Stored size: 536 Bytes

Contents

describe 'extensions' do
  describe 'Hash#to_canonical' do
    it 'generates the same hash regardless of hash order' do
      {a: 'a', b: 'b'}.to_canonical.should == {b: 'b', a: 'a'}.to_canonical
    end

    it 'generates the same hash with embedded hashses' do
      {a: 'a', b: { c: 'c'}}.to_canonical.should == {a: 'a', b: { c: 'c'}}.to_canonical
    end
    it 'generates the same hash with embedded arrays' do
      {a: 'a', b: { c: ['c', 'b']}}.to_canonical.should == {a: 'a', b: { c: ['b', 'c']}}.to_canonical
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
motion-yapper-0.1.0 spec/integration/extensions_spec.rb
motion-yapper-0.0.3 spec/integration/extensions_spec.rb
motion-yapper-0.0.2 spec/integration/extensions_spec.rb