Sha256: 1730ab800ebca8aa13f04798a717b12001f4e0bbd8a3b14497500fefc6034bde

Contents?: true

Size: 390 Bytes

Versions: 68

Compression:

Stored size: 390 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe Hash do
  describe '.[]' do
    it "should accept an Array argument (Ruby 1.8.6 and older)" do
      list = [['foo', 'bar'], ['foo2', 'bar2']]
      Hash[list].should == {'foo' => 'bar', 'foo2' => 'bar2'}
    end

    it "should accept an array as a key" do
      Hash[['a', 'b'], 1].should == {['a', 'b'] => 1}
    end
  end
end

Version data entries

68 entries across 52 versions & 7 rubygems

Version Path
challah-0.9.1.beta vendor/bundle/gems/yard-0.8.3/spec/core_ext/hash_spec.rb
challah-0.9.0 vendor/bundle/gems/yard-0.8.3/spec/core_ext/hash_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/yard-0.8.3/spec/core_ext/hash_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/yard-0.8.2.1/spec/core_ext/hash_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/yard-0.8.2.1/spec/core_ext/hash_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/yard-0.8.3/spec/core_ext/hash_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/yard-0.8.2.1/spec/core_ext/hash_spec.rb
challah-0.8.3 vendor/bundle/gems/yard-0.8.2.1/spec/core_ext/hash_spec.rb
challah-0.8.3 vendor/bundle/gems/yard-0.8.3/spec/core_ext/hash_spec.rb
yard-0.8.3 spec/core_ext/hash_spec.rb
challah-0.8.1 vendor/bundle/gems/yard-0.8.2.1/spec/core_ext/hash_spec.rb
challah-rolls-0.1.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/yard-0.8.2.1/spec/core_ext/hash_spec.rb
challah-rolls-0.1.0 vendor/bundle/gems/yard-0.8.2.1/spec/core_ext/hash_spec.rb
challah-0.8.0.pre vendor/bundle/gems/yard-0.8.2.1/spec/core_ext/hash_spec.rb
challah-0.7.1 vendor/bundle/gems/yard-0.8.2.1/spec/core_ext/hash_spec.rb
challah-0.7.0 vendor/bundle/gems/yard-0.8.2.1/spec/core_ext/hash_spec.rb
challah-0.7.0.pre2 vendor/bundle/gems/yard-0.8.2.1/spec/core_ext/hash_spec.rb
challah-0.7.0.pre vendor/bundle/gems/yard-0.8.2.1/spec/core_ext/hash_spec.rb
challah-0.6.2 vendor/bundle/gems/yard-0.8.2/spec/core_ext/hash_spec.rb
challah-0.6.2 vendor/bundle/gems/yard-0.8.1/spec/core_ext/hash_spec.rb