Sha256: a0a5fd40c60126d076e2cc9c273de57d894ac7470d4ef5ac04c94feb988514ab
Contents?: true
Size: 299 Bytes
Versions: 23
Compression:
Stored size: 299 Bytes
Contents
describe "Hash#to_a" do it "returns a list of [key, value] pairs with same order as each()" do h = {:a => 1, 1 => :a, 3 => :b, :b => 5} pairs = [] h.each_pair do |key, value| pairs << [key, value] end h.to_a.should be_kind_of(Array) h.to_a.should == pairs end end
Version data entries
23 entries across 23 versions & 1 rubygems