@@ -54,13 +54,20 @@ def handle_expected_error_message!(test_case, options)
54
54
interact ( test_case , :fail ) do |i |
55
55
i . prompt ( error_msg . nil? ? "An error message was expected but wasn't produced." :
56
56
"Error output doesn't match what was expected." )
57
+
58
+ i . choice ( :show_source , "Show me the input." ) do
59
+ display_text_block ( File . read ( test_case . input_path ) )
60
+ i . restart!
61
+ end
62
+
57
63
if error_msg . nil?
58
64
i . choice ( :show , "Show expected error." ) do
59
65
display_text_block ( expected_error_msg )
60
66
i . restart!
61
67
end
62
68
else
63
69
i . choice ( :show , "Show diff." ) do
70
+ require 'diffy'
64
71
display_text_block (
65
72
Diffy ::Diff . new ( "Expected\n #{ expected_error_msg } " ,
66
73
"Actual\n #{ error_msg } " ) . to_s ( :color ) )
@@ -110,7 +117,7 @@ def handle_unexpected_error_message!(test_case, options)
110
117
i . prompt "Unexpected output to stderr"
111
118
112
119
i . choice ( :show_source , "Show me the input." ) do
113
- display_text_block ( file . read ( test_case . input_path ) )
120
+ display_text_block ( File . read ( test_case . input_path ) )
114
121
i . restart!
115
122
end
116
123
@@ -157,7 +164,7 @@ def handle_output_difference!(test_case, options)
157
164
i . prompt "output does not match expectation"
158
165
159
166
i . choice ( :show_source , "Show me the input." ) do
160
- display_text_block ( file . read ( test_case . input_path ) )
167
+ display_text_block ( File . read ( test_case . input_path ) )
161
168
i . restart!
162
169
end
163
170
0 commit comments