5
5
require "tempfile"
6
6
7
7
class ErrorHighlightTest < Test ::Unit ::TestCase
8
- ErrorHighlight ::DefaultFormatter . snippet_max_width = 80
8
+ ErrorHighlight ::DefaultFormatter . max_snippet_width = 80
9
9
10
10
class DummyFormatter
11
11
def self . message_for ( corrections )
@@ -1338,9 +1338,9 @@ def test_errors_on_small_terminal_window_at_the_middle
1338
1338
1339
1339
def test_errors_on_extremely_small_terminal_window
1340
1340
custom_max_width = 30
1341
- original_max_width = ErrorHighlight ::DefaultFormatter . snippet_max_width
1341
+ original_max_width = ErrorHighlight ::DefaultFormatter . max_snippet_width
1342
1342
1343
- ErrorHighlight ::DefaultFormatter . snippet_max_width = custom_max_width
1343
+ ErrorHighlight ::DefaultFormatter . max_snippet_width = custom_max_width
1344
1344
1345
1345
assert_error_message ( NoMethodError , <<~END ) do
1346
1346
undefined method `time' for #{ ONE_RECV_MESSAGE }
@@ -1352,14 +1352,14 @@ def test_errors_on_extremely_small_terminal_window
1352
1352
100000000000000 + 1 . time { 100000000000000 }
1353
1353
end
1354
1354
ensure
1355
- ErrorHighlight ::DefaultFormatter . snippet_max_width = original_max_width
1355
+ ErrorHighlight ::DefaultFormatter . max_snippet_width = original_max_width
1356
1356
end
1357
1357
1358
1358
def test_errors_on_terminal_window_smaller_than_min_width
1359
1359
custom_max_width = 5
1360
- original_max_width = ErrorHighlight ::DefaultFormatter . snippet_max_width
1360
+ original_max_width = ErrorHighlight ::DefaultFormatter . max_snippet_width
1361
1361
1362
- ErrorHighlight ::DefaultFormatter . snippet_max_width = custom_max_width
1362
+ ErrorHighlight ::DefaultFormatter . max_snippet_width = custom_max_width
1363
1363
1364
1364
assert_error_message ( NoMethodError , <<~END ) do
1365
1365
undefined method `time' for #{ ONE_RECV_MESSAGE }
@@ -1371,14 +1371,14 @@ def test_errors_on_terminal_window_smaller_than_min_width
1371
1371
100000000000000 + 1 . time { 100000000000000 }
1372
1372
end
1373
1373
ensure
1374
- ErrorHighlight ::DefaultFormatter . snippet_max_width = original_max_width
1374
+ ErrorHighlight ::DefaultFormatter . max_snippet_width = original_max_width
1375
1375
end
1376
1376
1377
1377
def test_errors_on_terminal_window_when_truncation_is_disabled
1378
1378
custom_max_width = nil
1379
- original_max_width = ErrorHighlight ::DefaultFormatter . snippet_max_width
1379
+ original_max_width = ErrorHighlight ::DefaultFormatter . max_snippet_width
1380
1380
1381
- ErrorHighlight ::DefaultFormatter . snippet_max_width = custom_max_width
1381
+ ErrorHighlight ::DefaultFormatter . max_snippet_width = custom_max_width
1382
1382
1383
1383
assert_error_message ( NoMethodError , <<~END ) do
1384
1384
undefined method `time' for #{ ONE_RECV_MESSAGE }
@@ -1390,7 +1390,7 @@ def test_errors_on_terminal_window_when_truncation_is_disabled
1390
1390
10000000000000000000000000000000000000000000000000000000000000000000000 + 1 . time { 1000000000000000000000000000000 }
1391
1391
end
1392
1392
ensure
1393
- ErrorHighlight ::DefaultFormatter . snippet_max_width = original_max_width
1393
+ ErrorHighlight ::DefaultFormatter . max_snippet_width = original_max_width
1394
1394
end
1395
1395
1396
1396
def test_errors_on_small_terminal_window_when_larger_than_viewport
0 commit comments