Sha256: 694ffbe45bbb78e50fe278daf5df09ab3e1721c85da67b70728c9aff3ae4c60f
Contents?: true
Size: 388 Bytes
Versions: 8
Compression:
Stored size: 388 Bytes
Contents
require File.dirname(__FILE__) + '/../spec_helper' describe Hash do describe ".[]" do it "accepts an Array argument (Ruby 1.8.6 and older)" do list = [['foo', 'bar'], ['foo2', 'bar2']] expect(Hash[list]).to eq({'foo' => 'bar', 'foo2' => 'bar2'}) end it "accepts an array as a key" do expect(Hash[['a', 'b'], 1]).to eq({['a', 'b'] => 1}) end end end
Version data entries
8 entries across 7 versions & 2 rubygems