未验证 提交 6bc7c478 编写于 作者: A Aaron Patterson 提交者: GitHub

Merge pull request #39379 from zenspider/zenspider/fix-backtrace-in-master

This fixes tests for missing backtraces
......@@ -17,8 +17,6 @@ def record(result)
end
if output_inline? && result.failure && (!result.skipped? || options[:verbose])
result.failures.each { |f| f.backtrace.clear } if result.error?
io.puts
io.puts
io.puts color_output(result, by: result)
......
......@@ -72,7 +72,7 @@ def woot; end
@reporter.record(errored_test)
@reporter.report
expect = %r{\AE\n\nError:\nTestUnitReporterTest::ExampleTest#woot:\nArgumentError: wups\n \n\nrails test .*test/test_unit/reporter_test\.rb:\d+\n\n\z}
expect = %r{\AE\n\nError:\nTestUnitReporterTest::ExampleTest#woot:\nArgumentError: wups\n some_test.rb:4\n\nrails test .*test/test_unit/reporter_test\.rb:\d+\n\n\z}
assert_match expect, @output.string
end
......@@ -148,11 +148,21 @@ def woot; end
end
test "outputs colored failed results" do
@output.stub(:tty?, true) do
colored = Rails::TestUnitReporter.new @output, color: true, output_inline: true
colored.record(failed_test)
expected = %r{\e\[31mF\e\[0m\n\n\e\[31mFailure:\nTestUnitReporterTest::ExampleTest#woot \[test/test_unit/reporter_test.rb:\d+\]:\nboo\n\e\[0m\n\nrails test .*test/test_unit/reporter_test.rb:\d+\n\n}
assert_match expected, @output.string
end
end
test "outputs colored error results" do
@output.stub(:tty?, true) do
colored = Rails::TestUnitReporter.new @output, color: true, output_inline: true
colored.record(errored_test)
expected = %r{\e\[31mE\e\[0m\n\n\e\[31mError:\nTestUnitReporterTest::ExampleTest#woot:\nArgumentError: wups\n \n\e\[0m}
expected = %r{\e\[31mE\e\[0m\n\n\e\[31mError:\nTestUnitReporterTest::ExampleTest#woot:\nArgumentError: wups\n some_test.rb:4\n\e\[0m}
assert_match expected, @output.string
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册