summaryrefslogtreecommitdiff
path: root/test/lib/envutil.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib/envutil.rb')
-rw-r--r--test/lib/envutil.rb23
1 files changed, 10 insertions, 13 deletions
diff --git a/test/lib/envutil.rb b/test/lib/envutil.rb
index 1e0cf61b95..723bfdda06 100644
--- a/test/lib/envutil.rb
+++ b/test/lib/envutil.rb
@@ -351,22 +351,19 @@ module Test
raise "test_stderr ignored, use block only or without block" if test_stderr != []
yield(stdout.lines.map {|l| l.chomp }, stderr.lines.map {|l| l.chomp }, status)
else
- errs = []
- [[test_stdout, stdout], [test_stderr, stderr]].each do |exp, act|
- begin
- if exp.is_a?(Regexp)
- assert_match(exp, act, message)
- elsif exp.all? {|e| String === e}
- assert_equal(exp, act.lines.map {|l| l.chomp }, message)
- else
- assert_pattern_list(exp, act, message)
+ all_assertions(message) do |a|
+ [["stdout", test_stdout, stdout], ["stderr", test_stderr, stderr]].each do |key, exp, act|
+ a.for(key) do
+ if exp.is_a?(Regexp)
+ assert_match(exp, act)
+ elsif exp.all? {|e| String === e}
+ assert_equal(exp, act.lines.map {|l| l.chomp })
+ else
+ assert_pattern_list(exp, act)
+ end
end
- rescue MiniTest::Assertion => e
- errs << e.message
- message = nil
end
end
- raise MiniTest::Assertion, errs.join("\n---\n") unless errs.empty?
status
end
end