diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-09-27 21:07:53 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-09-27 21:07:53 +0900 |
commit | 03284fb91151bff5e12f1b7d5cdb0589f1ee43fb (patch) | |
tree | eebbef9bd3fbd685c96f67daebe7e964a991e3c0 /tool | |
parent | 8d0ff887274fdc73415035d652551d1fa0768c7b (diff) | |
download | ruby-03284fb91151bff5e12f1b7d5cdb0589f1ee43fb.tar.gz |
assert_in_out_err should use FailDesc too
Diffstat (limited to 'tool')
-rw-r--r-- | tool/lib/test/unit/core_assertions.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tool/lib/test/unit/core_assertions.rb b/tool/lib/test/unit/core_assertions.rb index 38201ca153..6e564c9a3f 100644 --- a/tool/lib/test/unit/core_assertions.rb +++ b/tool/lib/test/unit/core_assertions.rb @@ -52,15 +52,13 @@ module Test args = Array(args).dup args.insert((Hash === args[0] ? 1 : 0), '--disable=gems') stdout, stderr, status = EnvUtil.invoke_ruby(args, test_stdin, true, true, **opt) - if signo = status.termsig - EnvUtil.diagnostic_reports(Signal.signame(signo), status.pid, Time.now) - end + desc = FailDesc[status, message, stderr] if block_given? raise "test_stdout ignored, use block only or without block" if test_stdout != [] 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 - all_assertions(message) do |a| + all_assertions(desc) do |a| [["stdout", test_stdout, stdout], ["stderr", test_stderr, stderr]].each do |key, exp, act| a.for(key) do if exp.is_a?(Regexp) |