Sha256: 8e45400771f6f6a8fbfd29506e4bcaefa1fd618885b691198a71f4e7e4777c0a

Contents?: true

Size: 527 Bytes

Versions: 88

Compression:

Stored size: 527 Bytes

Contents

require 'spec_helper'

describe Hash do
  
  describe "to_dragonfly_unique_s" do
    it "should concatenate the to_s's of each of the elements, sorted alphabetically" do
      {'z' => nil, :a => 4, false => 'ice', 5 => 6.2}.to_dragonfly_unique_s.should == '56.2a4falseicez'
    end

    it "should nest correctly" do
      {:m => 1, :a => {:c => 2, :b => 3}, :z => 4}.to_dragonfly_unique_s.should == 'ab3c2m1z4'
    end
    
    it "should be empty if empty" do
      {}.to_dragonfly_unique_s.should == ''
    end
  end
  
end

Version data entries

88 entries across 88 versions & 3 rubygems

Version Path
classiccms-0.6.3 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.6.2 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.6.1 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.6.0 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.5.17 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.5.16 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.5.15 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.5.14 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.5.13 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.5.12 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.5.11 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.5.10 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.5.9 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.5.8 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.5.7 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.5.6 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.5.5 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.5.2 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.5.1 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.5.0 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb