File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -42,9 +42,13 @@ def run_spec_test(test_case, options = {})
42
42
assert_equal test_case . expected , clean_output , "Expected did not match output"
43
43
if test_case . verify_stderr?
44
44
# Compare only first line of error output (we can't compare stacktraces etc.)
45
- error_msg = error . each_line . next . rstrip
46
- expected_error_msg = test_case . expected_error . each_line . next . rstrip
47
- assert_equal expected_error_msg , error_msg , "Expected did not match error"
45
+ begin
46
+ error_msg = error . each_line . next . rstrip
47
+ expected_error_msg = test_case . expected_error . each_line . next . rstrip
48
+ assert_equal expected_error_msg , error_msg , "Expected did not match error"
49
+ rescue StopIteration
50
+ assert_equal expected_error_msg , "" , "No error message produced"
51
+ end
48
52
end
49
53
rescue Minitest ::Assertion
50
54
if test_case . todo? && options [ :unexpected_pass ]
You can’t perform that action at this time.
0 commit comments