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
dragonfly-1.4.1 spec/dragonfly/core_ext/hash_spec.rb
dragonfly-1.4.0 spec/dragonfly/core_ext/hash_spec.rb
dragonfly-1.3.0 spec/dragonfly/core_ext/hash_spec.rb
dragonfly-1.2.1 spec/dragonfly/core_ext/hash_spec.rb
dragonfly-1.2.0 spec/dragonfly/core_ext/hash_spec.rb
dragonfly-1.1.5 spec/dragonfly/core_ext/hash_spec.rb
dragonfly-1.1.4 spec/dragonfly/core_ext/hash_spec.rb
dragonfly-1.1.3 spec/dragonfly/core_ext/hash_spec.rb
dragonfly-1.1.2 spec/dragonfly/core_ext/hash_spec.rb
dragonfly-1.1.1 spec/dragonfly/core_ext/hash_spec.rb
dragonfly-1.1.0 spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.7.5 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.7.4 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
classiccms-0.7.3 vendor/bundle/gems/dragonfly-0.9.12/spec/dragonfly/core_ext/hash_spec.rb
dragonfly-1.0.12 spec/dragonfly/core_ext/hash_spec.rb
dragonfly-1.0.11 spec/dragonfly/core_ext/hash_spec.rb
dragonfly-1.0.10 spec/dragonfly/core_ext/hash_spec.rb
dragonfly-1.0.9 spec/dragonfly/core_ext/hash_spec.rb
dragonfly-1.0.8 spec/dragonfly/core_ext/hash_spec.rb
dragonfly-1.0.7 spec/dragonfly/core_ext/hash_spec.rb