diff options
Diffstat (limited to 'test/ruby/test_hash.rb')
-rw-r--r-- | test/ruby/test_hash.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index bcfe13cbb3..e3c92125c5 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -718,6 +718,10 @@ class TestHash < Test::Unit::TestCase def test_default_proc h = Hash.new {|hh, k| hh + k + "baz" } assert_equal("foobarbaz", h.default_proc.call("foo", "bar")) + assert_nil(h.default_proc = nil) + assert_nil(h.default_proc) + h.default_proc = ->(h, k){ true } + assert(h[:nope]) h = {} assert_nil(h.default_proc) end |