diff options
author | NARUSE, Yui <naruse@airemix.jp> | 2020-02-04 21:51:57 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2020-02-04 21:51:57 +0900 |
commit | 390a9d3b725a4ea7852f2cabf066b78855869472 (patch) | |
tree | 91d9a227bc7606767d939201d7e192843c05dbbe /tool | |
parent | 3c7a09ece8f5ddab2a0e71918dc976cd1cd0ec92 (diff) |
just use STDOUT
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 7ff986127f..8911fadae3 100644 --- a/tool/lib/test/unit/core_assertions.rb +++ b/tool/lib/test/unit/core_assertions.rb @@ -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}" } |