Sha256: 13ccf588c740f45ff72467fc6f06f2400848ffa031c11d4ab194a8553b4bd44c
Contents?: true
Size: 765 Bytes
Versions: 83
Compression:
Stored size: 765 Bytes
Contents
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../spec_helper' describe "Hash literal" do it "{} should return an empty hash" do {}.size.should == 0 {}.should == {} end it "{} should return a new hash populated with the given elements" do h = {:a => 'a', 'b' => 3, 44 => 2.3} h.size.should == 3 h.should == {:a => "a", "b" => 3, 44 => 2.3} end it "treats empty expressions as nils" do h = {() => ()} h.keys.should == [nil] h.values.should == [nil] h[nil].should == nil h = {() => :value} h.keys.should == [nil] h.values.should == [:value] h[nil].should == :value h = {:key => ()} h.keys.should == [:key] h.values.should == [nil] h[:key].should == nil end end
Version data entries
83 entries across 83 versions & 1 rubygems