HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-2.5.9/spec/ruby/core/hash/shared/length.rb
describe :hash_length, shared: true do
  it "returns the number of entries" do
    { a: 1, b: 'c' }.send(@method).should == 2
    h = { a: 1, b: 2 }
    h[:a] = 2
    h.send(@method).should == 2
    { a: 1, b: 1, c: 1 }.send(@method).should == 3
    {}.send(@method).should == 0
    Hash.new(5).send(@method).should == 0
    Hash.new { 5 }.send(@method).should == 0
  end
end