Sha256: 9b38e7db600b74d4a6c3d1bad82be67e9e600cf7dc0fc690068b260be0742bb9
Contents?: true
Size: 394 Bytes
Versions: 45
Compression:
Stored size: 394 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
45 entries across 45 versions & 4 rubygems