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
1362
1362
1363
1363
warning = nil
1364
1364
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
1366
1369
begin
1367
1370
ErrorHighlight ::DefaultFormatter . max_snippet_width = custom_max_width
1368
1371
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
1371
1376
end
1372
1377
assert_match "'max_snippet_width' adjusted to minimum value of #{ min_snippet_width } " , warning
1373
1378
You can’t perform that action at this time.
0 commit comments