From d05383812adf86e6c6a536246c03a2d401f10058 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 10 Sep 2021 20:56:07 +0900 Subject: Replace Test::Assertion and Test::Skip to Test::Unit::AssertionFailedError and Test::Unit::PendedError --- tool/lib/core_assertions.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tool/lib/core_assertions.rb') 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 -- cgit v1.2.3