File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1362,12 +1362,17 @@ def test_errors_on_terminal_window_smaller_than_min_width
13621362
13631363 warning = nil
13641364 original_warn = Warning . method ( :warn )
1365- Warning . define_method ( :warn ) { |s | warning = s }
1365+ Warning . class_eval do
1366+ remove_method ( :warn )
1367+ define_method ( :warn ) { |str | warning = str }
1368+ end
13661369 begin
13671370 ErrorHighlight ::DefaultFormatter . max_snippet_width = custom_max_width
13681371 ensure
1369- Warning . remove_method ( :warn )
1370- Warning . define_method ( :warn , original_warn )
1372+ Warning . class_eval do
1373+ remove_method ( :warn )
1374+ define_method ( :warn , original_warn )
1375+ end
13711376 end
13721377 assert_match "'max_snippet_width' adjusted to minimum value of #{ min_snippet_width } " , warning
13731378
You can’t perform that action at this time.
0 commit comments