@@ -25,11 +25,13 @@ def teardown
25
25
26
26
if Exception . method_defined? ( :detailed_message )
27
27
def assert_error_message ( klass , expected_msg , &blk )
28
+ omit unless klass < ErrorHighlight ::CoreExt
28
29
err = assert_raise ( klass , &blk )
29
30
assert_equal ( expected_msg . chomp , err . detailed_message ( highlight : false ) . sub ( / \( (?:NoMethod|Name)Error\) / , "" ) )
30
31
end
31
32
else
32
33
def assert_error_message ( klass , expected_msg , &blk )
34
+ omit unless klass < ErrorHighlight ::CoreExt
33
35
err = assert_raise ( klass , &blk )
34
36
assert_equal ( expected_msg . chomp , err . message )
35
37
end
@@ -987,11 +989,9 @@ def test_multibyte
987
989
end
988
990
end
989
991
990
- if false
991
-
992
992
def test_args_CALL_1
993
993
assert_error_message ( TypeError , <<~END ) do
994
- nil can't be coerced into Integer
994
+ nil can't be coerced into Integer (TypeError)
995
995
996
996
1.+(nil)
997
997
^^^
@@ -1004,7 +1004,7 @@ def test_args_CALL_1
1004
1004
def test_args_CALL_2
1005
1005
v = [ ]
1006
1006
assert_error_message ( TypeError , <<~END ) do
1007
- no implicit conversion from nil to integer
1007
+ no implicit conversion from nil to integer (TypeError)
1008
1008
1009
1009
v[nil]
1010
1010
^^^
@@ -1017,7 +1017,7 @@ def test_args_CALL_2
1017
1017
def test_args_ATTRASGN_1
1018
1018
v = [ ]
1019
1019
assert_error_message ( ArgumentError , <<~END ) do
1020
- wrong number of arguments (given 1, expected 2..3)
1020
+ wrong number of arguments (given 1, expected 2..3) (ArgumentError)
1021
1021
1022
1022
v [ ] = 1
1023
1023
^^^^^^
@@ -1030,7 +1030,7 @@ def test_args_ATTRASGN_1
1030
1030
def test_args_ATTRASGN_2
1031
1031
v = [ ]
1032
1032
assert_error_message ( TypeError , <<~END ) do
1033
- no implicit conversion from nil to integer
1033
+ no implicit conversion from nil to integer (TypeError)
1034
1034
1035
1035
v [nil] = 1
1036
1036
^^^^^^^^
@@ -1042,7 +1042,7 @@ def test_args_ATTRASGN_2
1042
1042
1043
1043
def test_args_ATTRASGN_3
1044
1044
assert_error_message ( TypeError , <<~END ) do
1045
- no implicit conversion of String into Integer
1045
+ no implicit conversion of String into Integer (TypeError)
1046
1046
1047
1047
$stdin.lineno = "str"
1048
1048
^^^^^
@@ -1054,7 +1054,7 @@ def test_args_ATTRASGN_3
1054
1054
1055
1055
def test_args_OPCALL
1056
1056
assert_error_message ( TypeError , <<~END ) do
1057
- nil can't be coerced into Integer
1057
+ nil can't be coerced into Integer (TypeError)
1058
1058
1059
1059
1 + nil
1060
1060
^^^
@@ -1066,7 +1066,7 @@ def test_args_OPCALL
1066
1066
1067
1067
def test_args_FCALL_1
1068
1068
assert_error_message ( TypeError , <<~END ) do
1069
- no implicit conversion of Symbol into String
1069
+ no implicit conversion of Symbol into String (TypeError)
1070
1070
1071
1071
"str".instance_eval { gsub("foo", :sym) }
1072
1072
^^^^^^^^^^^
@@ -1078,7 +1078,7 @@ def test_args_FCALL_1
1078
1078
1079
1079
def test_args_FCALL_2
1080
1080
assert_error_message ( TypeError , <<~END ) do
1081
- no implicit conversion of Symbol into String
1081
+ no implicit conversion of Symbol into String (TypeError)
1082
1082
1083
1083
"str".instance_eval { gsub "foo", :sym }
1084
1084
^^^^^^^^^^^
@@ -1092,7 +1092,7 @@ def test_args_OP_ASGN1_aref_1
1092
1092
v = [ ]
1093
1093
1094
1094
assert_error_message ( TypeError , <<~END ) do
1095
- no implicit conversion from nil to integer
1095
+ no implicit conversion from nil to integer (TypeError)
1096
1096
1097
1097
v [nil] += 42
1098
1098
^^^^^^^^^^
@@ -1106,7 +1106,7 @@ def test_args_OP_ASGN1_aref_2
1106
1106
v = [ ]
1107
1107
1108
1108
assert_error_message ( ArgumentError , <<~END ) do
1109
- wrong number of arguments (given 0, expected 1..2)
1109
+ wrong number of arguments (given 0, expected 1..2) (ArgumentError)
1110
1110
1111
1111
v [ ] += 42
1112
1112
^^^^^^^^
@@ -1120,7 +1120,7 @@ def test_args_OP_ASGN1_op
1120
1120
v = [ 1 ]
1121
1121
1122
1122
assert_error_message ( TypeError , <<~END ) do
1123
- nil can't be coerced into Integer
1123
+ nil can't be coerced into Integer (TypeError)
1124
1124
1125
1125
v [0] += nil
1126
1126
^^^^^^^^^
@@ -1135,7 +1135,7 @@ def test_args_OP_ASGN2
1135
1135
def v . foo ; 1 ; end
1136
1136
1137
1137
assert_error_message ( TypeError , <<~END ) do
1138
- nil can't be coerced into Integer
1138
+ nil can't be coerced into Integer (TypeError)
1139
1139
1140
1140
v.foo += nil
1141
1141
^^^
@@ -1145,8 +1145,6 @@ def v.foo; 1; end
1145
1145
end
1146
1146
end
1147
1147
1148
- end
1149
-
1150
1148
def test_custom_formatter
1151
1149
custom_formatter = Object . new
1152
1150
def custom_formatter . message_for ( spot )
0 commit comments