summaryrefslogtreecommitdiff
path: root/tool/lib/core_assertions.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-09-10 20:56:07 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-09-11 08:48:03 +0900
commitd05383812adf86e6c6a536246c03a2d401f10058 (patch)
treee45fbc574fb2b93b1426a5f258005e98f4f1ac72 /tool/lib/core_assertions.rb
parent7cec81e073ed1d29910b3e1dc4dd5d7e9d2b490f (diff)
Replace Test::Assertion and Test::Skip to Test::Unit::AssertionFailedError and Test::Unit::PendedError
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4813
Diffstat (limited to 'tool/lib/core_assertions.rb')
-rw-r--r--tool/lib/core_assertions.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/tool/lib/core_assertions.rb b/tool/lib/core_assertions.rb
index f94a5dff66..8800487971 100644
--- a/tool/lib/core_assertions.rb
+++ b/tool/lib/core_assertions.rb
@@ -103,7 +103,7 @@ module Test
pend 'assert_no_memory_leak may consider MJIT memory usage as leak' if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
require_relative 'memory_status'
- raise Test::Skip, "unsupported platform" unless defined?(Memory::Status)
+ raise Test::Unit::PendedError, "unsupported platform" unless defined?(Memory::Status)
token = "\e[7;1m#{$$.to_s}:#{Time.now.strftime('%s.%L')}:#{rand(0x10000).to_s(16)}:\e[m"
token_dump = token.dump
@@ -168,11 +168,11 @@ module Test
end
begin
line = __LINE__; yield
- rescue Test::Skip
+ rescue Test::Unit::PendedError
raise
rescue Exception => e
bt = e.backtrace
- as = e.instance_of?(Test::Assertion)
+ as = e.instance_of?(Test::Unit::AssertionFailedError)
if as
ans = /\A#{Regexp.quote(__FILE__)}:#{line}:in /o
bt.reject! {|ln| ans =~ ln}
@@ -184,7 +184,7 @@ module Test
"Backtrace:\n" +
e.backtrace.map{|frame| " #{frame}"}.join("\n")
}
- raise Test::Assertion, msg.call, bt
+ raise Test::Unit::AssertionFailedError, msg.call, bt
else
raise
end
@@ -387,8 +387,8 @@ eom
begin
yield
- rescue Test::Skip => e
- return e if exp.include? Test::Skip
+ rescue Test::Unit::PendedError => e
+ return e if exp.include? Test::Unit::PendedError
raise e
rescue Exception => e
expected = exp.any? { |ex|
@@ -699,7 +699,7 @@ eom
if message
msg = "#{message}\n#{msg}"
end
- raise Test::Assertion, msg
+ raise Test::Unit::AssertionFailedError, msg
end
end