Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (17 sloc) 379 Bytes
require File.expand_path('../test_helper', __FILE__)
describe 'Hash initialized with block' do
it 'should add 1 to the key' do
h = Hash.new do |hash, key|
hash[key] = key + 1
end
h[1]
h[1].must_equal 2
end
it 'should ' do
h = Hash.new do |hash, key|
hash[key] = 'default'
end
h[:foo]
h[:foo].must_equal 'default'
end
end
Jump to Line
Something went wrong with that request. Please try again.