aboutsummaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-05 08:47:47 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-05 08:53:21 +0900
commitc6cd4206df516da1c6b1935f045e22e0ef7f0709 (patch)
treefec9a9ebd518ef910166cfa833ab4957e7bc63cd /tool
parent390a9d3b725a4ea7852f2cabf066b78855869472 (diff)
downloadruby-c6cd4206df516da1c6b1935f045e22e0ef7f0709.tar.gz
Get rid of nested string interpolations to be editor-friendly
Diffstat (limited to 'tool')
-rw-r--r--tool/lib/test/unit/core_assertions.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/tool/lib/test/unit/core_assertions.rb b/tool/lib/test/unit/core_assertions.rb
index 8911fadae3..aa5c7d618d 100644
--- a/tool/lib/test/unit/core_assertions.rb
+++ b/tool/lib/test/unit/core_assertions.rb
@@ -110,14 +110,16 @@ module Test
file ||= loc.path
line ||= loc.lineno
end
- if /mswin|mingw/ !~ RUBY_PLATFORM
+ if /mswin|mingw/ =~ RUBY_PLATFORM
+ res_out = "STDOUT"
+ else
res_p, res_c = IO.pipe
opt[res_c.fileno] = res_c.fileno
- res_fd = res_c.fileno
+ res_out = "IO.new(#{res_c.fileno}, 'w')"
end
src = <<eom
# -*- coding: #{line += __LINE__; src.encoding}; -*-
- require "test/unit";out=#{res_fd ? "IO.new(#{res_fd})" : "STDOUT"};include Test::Unit::Assertions;require #{(__dir__ + "/core_assertions").dump};include Test::Unit::CoreAssertions
+ require "test/unit";out=#{res_out};include Test::Unit::Assertions;require #{(__dir__ + "/core_assertions").dump};include Test::Unit::CoreAssertions
END {
out.puts [Marshal.dump($!)].pack('m'), "assertions=\#{self._assertions}"
}