1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

just use STDOUT

This commit is contained in:
NARUSE, Yui 2020-02-04 21:51:57 +09:00
parent 3c7a09ece8
commit 390a9d3b72

View file

@ -110,16 +110,14 @@ module Test
file ||= loc.path
line ||= loc.lineno
end
if /mswin|mingw/ =~ RUBY_PLATFORM
res_fd = 1 # STDOUT
else
if /mswin|mingw/ !~ RUBY_PLATFORM
res_p, res_c = IO.pipe
opt[res_c.fileno] = res_c.fileno
res_fd = res_c.fileno
end
src = <<eom
# -*- coding: #{line += __LINE__; src.encoding}; -*-
require "test/unit";out=IO.new(#{res_fd});include Test::Unit::Assertions;require #{(__dir__ + "/core_assertions").dump};include Test::Unit::CoreAssertions
require "test/unit";out=#{res_fd ? "IO.new(#{res_fd})" : "STDOUT"};include Test::Unit::Assertions;require #{(__dir__ + "/core_assertions").dump};include Test::Unit::CoreAssertions
END {
out.puts [Marshal.dump($!)].pack('m'), "assertions=\#{self._assertions}"
}