diff --git a/lib/pp.rb b/lib/pp.rb index 81a9a1629c..dede0d1517 100644 --- a/lib/pp.rb +++ b/lib/pp.rb @@ -223,7 +223,7 @@ class PP < PrettyPrint else sep.call end - yield(*v) + yield(*v, **{}) } end diff --git a/test/test_pp.rb b/test/test_pp.rb index 3262417fba..026b2ac9f7 100644 --- a/test/test_pp.rb +++ b/test/test_pp.rb @@ -176,6 +176,10 @@ class PPSingleLineTest < Test::Unit::TestCase assert_equal("{1=>1}", PP.singleline_pp({ 1 => 1}, ''.dup)) # [ruby-core:02699] assert_equal("[1#{', 1'*99}]", PP.singleline_pp([1]*100, ''.dup)) end + + def test_hash_in_array + assert_equal("[{}]", PP.singleline_pp([->(*a){a.last}.ruby2_keywords.call(**{})], ''.dup)) + end end class PPDelegateTest < Test::Unit::TestCase