Sha256: 8cf8cb7e2a69bf6c63a78e9a6d34026315ef3503a7c68665910302011ce7189e

Contents?: true

Size: 269 Bytes

Versions: 29

Compression:

Stored size: 269 Bytes

Contents

describe "Hash#empty?" do
  it "returns true if the hash has no entries" do
    {}.empty?.should == true
    {1 => 1}.empty?.should == false
  end

  it "returns true if the hash has no entires and has a default value" do
    Hash.new(5).empty?.should == true
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
opal-0.4.4 spec/rubyspec/core/hash/empty_spec.rb
opal-0.4.3 spec/rubyspec/core/hash/empty_spec.rb
opal-0.4.2 spec/rubyspec/core/hash/empty_spec.rb
opal-0.4.1 spec/rubyspec/core/hash/empty_spec.rb
opal-0.4.0 spec/rubyspec/core/hash/empty_spec.rb
opal-0.3.44 spec/rubyspec/core/hash/empty_spec.rb
opal-0.3.43 spec/rubyspec/core/hash/empty_spec.rb
opal-0.3.42 spec/core/hash/empty_spec.rb
opal-0.3.41 spec/core/hash/empty_spec.rb
opal-0.3.40 spec/core/hash/empty_spec.rb
opal-0.3.39 spec/core/hash/empty_spec.rb
opal-0.3.38 spec/core/hash/empty_spec.rb
opal-0.3.37 spec/core/hash/empty_spec.rb
opal-0.3.36 spec/core/hash/empty_spec.rb
opal-0.3.35 spec/core/hash/empty_spec.rb
opal-0.3.34 spec/core/hash/empty_spec.rb
opal-0.3.33 spec/core/hash/empty_spec.rb
opal-0.3.32 spec/core/hash/empty_spec.rb
opal-0.3.31 spec/core/hash/empty_spec.rb
opal-0.3.30 spec/core/hash/empty_spec.rb