Skip to content

Commit 77f980e

Browse files
committed
Merge branch 'empty_stderr'
2 parents e7db182 + e2335cb commit 77f980e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/sass_spec/test.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ def run_spec_test(test_case, options = {})
4242
assert_equal test_case.expected, clean_output, "Expected did not match output"
4343
if test_case.verify_stderr?
4444
# 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
4852
end
4953
rescue Minitest::Assertion
5054
if test_case.todo? && options[:unexpected_pass]

0 commit comments

Comments
 (0)