File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -273,8 +273,21 @@ def test_hash_symbol_colon_key
273273
274274 def test_hash_in_array
275275 omit if RUBY_ENGINE == "jruby"
276- assert_equal ( "[{}]" , PP . singleline_pp ( [ -> ( *a ) { a . last . clear } . ruby2_keywords . call ( a : 1 ) ] , '' . dup ) )
277- assert_equal ( "[{}]" , PP . singleline_pp ( [ Hash . ruby2_keywords_hash ( { } ) ] , '' . dup ) )
276+ assert_equal ( "[{}]" , passing_keywords { PP . singleline_pp ( [ -> ( *a ) { a . last . clear } . ruby2_keywords . call ( a : 1 ) ] , '' . dup ) } )
277+ assert_equal ( "[{}]" , passing_keywords { PP . singleline_pp ( [ Hash . ruby2_keywords_hash ( { } ) ] , '' . dup ) } )
278+ end
279+
280+ if RUBY_VERSION >= "3.0"
281+ def passing_keywords ( &_ )
282+ yield
283+ end
284+ else
285+ def passing_keywords ( &_ )
286+ verbose , $VERBOSE = $VERBOSE, nil
287+ yield
288+ ensure
289+ $VERBOSE = verbose
290+ end
278291 end
279292
280293 def test_direct_pp
You can’t perform that action at this time.
0 commit comments