summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2020-12-23 13:15:49 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-12-23 13:53:40 +0900
commit61bd28b836190bbc8ce110e780da4c4aad9f485b (patch)
tree14a6d67ce8e3bd45379d672c0906145961cf3f0d /tool
parent8a1e12499b83870f9f102f0f0ea512f0355aac67 (diff)
[ruby/date] Workaround for non-ruby repository like ruby/date, flori/json
https://github.com/ruby/date/commit/1ff7fa2d80
Diffstat (limited to 'tool')
-rw-r--r--tool/lib/test/unit/core_assertions.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/tool/lib/test/unit/core_assertions.rb b/tool/lib/test/unit/core_assertions.rb
index 16d5e14fb1..abd0e45035 100644
--- a/tool/lib/test/unit/core_assertions.rb
+++ b/tool/lib/test/unit/core_assertions.rb
@@ -264,7 +264,7 @@ module Test
at_exit {
out.puts [Marshal.dump($!)].pack('m'), "assertions=\#{self._assertions}"
}
- Test::Unit::Runner.class_variable_set(:@@stop_auto_run, true)
+ Test::Unit::Runner.class_variable_set(:@@stop_auto_run, true) if defined?(Test::Unit::Runner)
end
def assert_separately(args, file = nil, line = nil, src, ignore_stderr: nil, **opt)
@@ -276,7 +276,7 @@ module Test
capture_stdout = true
unless /mswin|mingw/ =~ RUBY_PLATFORM
capture_stdout = false
- opt[:out] = MiniTest::Unit.output
+ opt[:out] = MiniTest::Unit.output if defined?(MiniTest::Unit)
res_p, res_c = IO.pipe
opt[res_c.fileno] = res_c.fileno
end