ruby-changes:67639
From: Hiroshi <ko1@a...>
Date: Mon, 6 Sep 2021 21:20:03 +0900 (JST)
Subject: [ruby-changes:67639] 940a19e4b3 (master): Use Test::Unit::AssertionFailedError instead of MiniTest::Assertion for test-unit migration
https://git.ruby-lang.org/ruby.git/commit/?id=940a19e4b3 From 940a19e4b3ae1ce466c3bc912175b4ef7c615c53 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA <hsbt@r...> Date: Mon, 6 Sep 2021 18:34:15 +0900 Subject: Use Test::Unit::AssertionFailedError instead of MiniTest::Assertion for test-unit migration --- test/-ext-/float/test_nextafter.rb | 2 +- test/fileutils/test_fileutils.rb | 2 +- test/ruby/test_exception.rb | 2 +- test/socket/test_addrinfo.rb | 2 +- test/socket/test_basicsocket.rb | 2 +- test/zlib/test_zlib.rb | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/-ext-/float/test_nextafter.rb b/test/-ext-/float/test_nextafter.rb index 636f803..e0a7693 100644 --- a/test/-ext-/float/test_nextafter.rb +++ b/test/-ext-/float/test_nextafter.rb @@ -50,7 +50,7 @@ class TestFloatExt < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/-ext-/float/test_nextafter.rb#L50 assert_equal(s1, s2, "Bug::Float.missing_nextafter(#{'%a' % n1}, #{'%a' % n2}) = #{'%a' % v1} != " + "#{'%a' % v2} = Bug::Float.system_nextafter(#{'%a' % n1}, #{'%a' % n2})") - rescue Minitest::Assertion + rescue Test::Unit::AssertionFailedError if /aix/ =~ RUBY_PLATFORM skip "Known bug in nextafter(3) on AIX" end diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index 63936d1..36b5d6e 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -242,7 +242,7 @@ class TestFileUtils < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/fileutils/test_fileutils.rb#L242 # def test_assert_output_lines - assert_raise(MiniTest::Assertion) { + assert_raise(Test::Unit::AssertionFailedError) { Timeout.timeout(0.5) { assert_output_lines([]) { Thread.current.report_on_exception = false diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index d1ff561..67f38c2 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -577,7 +577,7 @@ end.join https://github.com/ruby/ruby/blob/trunk/test/ruby/test_exception.rb#L577 end end; end - rescue Minitest::Assertion + rescue Test::Unit::AssertionFailedError # Possibly compiled with -DRUBY_DEBUG, in which # case rb_bug is used instead of NoMemoryError, # and we cannot test ensure after NoMemoryError. diff --git a/test/socket/test_addrinfo.rb b/test/socket/test_addrinfo.rb index e068c6c..5bd34cd 100644 --- a/test/socket/test_addrinfo.rb +++ b/test/socket/test_addrinfo.rb @@ -586,7 +586,7 @@ class TestSocketAddrinfo < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/socket/test_addrinfo.rb#L586 ai = ipv6(addr) begin assert(ai.ipv4? || ai.send(meth), "ai=#{addr_exp}; ai.ipv4? || .#{meth}") - rescue Minitest::Assertion + rescue Test::Unit::AssertionFailedError if /aix/ =~ RUBY_PLATFORM skip "Known bug in IN6_IS_ADDR_V4COMPAT and IN6_IS_ADDR_V4MAPPED on AIX" end diff --git a/test/socket/test_basicsocket.rb b/test/socket/test_basicsocket.rb index 7b1c9b4..02e393d 100644 --- a/test/socket/test_basicsocket.rb +++ b/test/socket/test_basicsocket.rb @@ -32,7 +32,7 @@ class TestSocket_BasicSocket < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/socket/test_basicsocket.rb#L32 n = s.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR) assert_equal([0].pack("i"), n.data) - rescue Minitest::Assertion + rescue Test::Unit::AssertionFailedError s.close if /aix/ =~ RUBY_PLATFORM skip "Known bug in getsockopt(2) on AIX" diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb index 4780bc0..a629c0c 100644 --- a/test/zlib/test_zlib.rb +++ b/test/zlib/test_zlib.rb @@ -1319,7 +1319,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L1319 assert_equal(0x02820145, Zlib.adler32_combine(one, two, 1)) rescue NotImplementedError skip "adler32_combine is not implemented" - rescue Minitest::Assertion + rescue Test::Unit::AssertionFailedError if /aix/ =~ RUBY_PLATFORM skip "zconf.h in zlib does not handle _LARGE_FILES in AIX. Skip until it is fixed" end @@ -1354,7 +1354,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L1354 assert_equal(0x8c736521, Zlib.crc32_combine(one, two, 1)) rescue NotImplementedError skip "crc32_combine is not implemented" - rescue Minitest::Assertion + rescue Test::Unit::AssertionFailedError if /aix/ =~ RUBY_PLATFORM skip "zconf.h in zlib does not handle _LARGE_FILES in AIX. Skip until it is fixed" end -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/