[前][次][番号順一覧][スレッド一覧]

ruby-changes:47206

From: hsbt <ko1@a...>
Date: Thu, 13 Jul 2017 18:46:29 +0900 (JST)
Subject: [ruby-changes:47206] hsbt:r59321 (trunk): Use Test::Unit::TestCase instead of MiniTest::Unit::TestCase. Because

hsbt	2017-07-13 18:46:16 +0900 (Thu, 13 Jul 2017)

  New Revision: 59321

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59321

  Log:
    Use Test::Unit::TestCase instead of MiniTest::Unit::TestCase. Because
    tests of fiddle already used customized assertions of ruby core.
    
      * test/fiddle/helper.rb: Use Test::Unit::TestCase for base class of
        testcase.
      * test/fiddle/test_*.rb: Use assert_raise instead of assert_raises.
        Remove needless includes for Test::Unit::Assertions.

  Modified files:
    trunk/test/fiddle/helper.rb
    trunk/test/fiddle/test_closure.rb
    trunk/test/fiddle/test_cparser.rb
    trunk/test/fiddle/test_func.rb
    trunk/test/fiddle/test_function.rb
    trunk/test/fiddle/test_handle.rb
    trunk/test/fiddle/test_import.rb
    trunk/test/fiddle/test_pointer.rb
Index: test/fiddle/test_cparser.rb
===================================================================
--- test/fiddle/test_cparser.rb	(revision 59320)
+++ test/fiddle/test_cparser.rb	(revision 59321)
@@ -61,7 +61,7 @@ module Fiddle https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_cparser.rb#L61
     end
 
     def test_undefined_ctype
-      assert_raises(DLError) { parse_ctype('DWORD') }
+      assert_raise(DLError) { parse_ctype('DWORD') }
     end
 
     def test_undefined_ctype_with_type_alias
@@ -93,7 +93,7 @@ module Fiddle https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_cparser.rb#L93
     end
 
     def test_struct_undefined
-      assert_raises(DLError) { parse_struct_signature(['int i', 'DWORD cb']) }
+      assert_raise(DLError) { parse_struct_signature(['int i', 'DWORD cb']) }
     end
 
     def test_struct_undefined_with_type_alias
Index: test/fiddle/helper.rb
===================================================================
--- test/fiddle/helper.rb	(revision 59320)
+++ test/fiddle/helper.rb	(revision 59321)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/test/fiddle/helper.rb#L1
 # frozen_string_literal: false
-require 'minitest/autorun'
+require 'test/unit'
 require 'fiddle'
 
 # FIXME: this is stolen from DL and needs to be refactored.
@@ -108,7 +108,7 @@ Fiddle::LIBC_SO = libc_so https://github.com/ruby/ruby/blob/trunk/test/fiddle/helper.rb#L108
 Fiddle::LIBM_SO = libm_so
 
 module Fiddle
-  class TestCase < MiniTest::Unit::TestCase
+  class TestCase < Test::Unit::TestCase
     def setup
       @libc = Fiddle.dlopen(LIBC_SO)
       @libm = Fiddle.dlopen(LIBM_SO)
Index: test/fiddle/test_pointer.rb
===================================================================
--- test/fiddle/test_pointer.rb	(revision 59320)
+++ test/fiddle/test_pointer.rb	(revision 59321)
@@ -10,8 +10,6 @@ module Fiddle https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_pointer.rb#L10
       Fiddle.dlwrap arg
     end
 
-    include Test::Unit::Assertions
-
     def test_cptr_to_int
       null = Fiddle::NULL
       assert_equal(null.to_i, null.to_int)
Index: test/fiddle/test_function.rb
===================================================================
--- test/fiddle/test_function.rb	(revision 59320)
+++ test/fiddle/test_function.rb	(revision 59321)
@@ -6,8 +6,6 @@ end https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_function.rb#L6
 
 module Fiddle
   class TestFunction < Fiddle::TestCase
-    include Test::Unit::Assertions
-
     def setup
       super
       Fiddle.last_error = nil
Index: test/fiddle/test_import.rb
===================================================================
--- test/fiddle/test_import.rb	(revision 59320)
+++ test/fiddle/test_import.rb	(revision 59321)
@@ -45,7 +45,7 @@ module Fiddle https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_import.rb#L45
 
   class TestImport < TestCase
     def test_ensure_call_dlload
-      err = assert_raises(RuntimeError) do
+      err = assert_raise(RuntimeError) do
         Class.new do
           extend Importer
           extern "void *strcpy(char*, char*)"
Index: test/fiddle/test_func.rb
===================================================================
--- test/fiddle/test_func.rb	(revision 59320)
+++ test/fiddle/test_func.rb	(revision 59321)
@@ -13,7 +13,7 @@ module Fiddle https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_func.rb#L13
 
     def test_syscall_with_tainted_string
       f = Function.new(@libc['system'], [TYPE_VOIDP], TYPE_INT)
-      assert_raises(SecurityError) do
+      assert_raise(SecurityError) do
         Thread.new {
           $SAFE = 1
           f.call("uname -rs".taint)
Index: test/fiddle/test_handle.rb
===================================================================
--- test/fiddle/test_handle.rb	(revision 59320)
+++ test/fiddle/test_handle.rb	(revision 59321)
@@ -8,8 +8,6 @@ module Fiddle https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_handle.rb#L8
   class TestHandle < TestCase
     include Fiddle
 
-    include Test::Unit::Assertions
-
     def test_safe_handle_open
       t = Thread.new do
         $SAFE = 1
Index: test/fiddle/test_closure.rb
===================================================================
--- test/fiddle/test_closure.rb	(revision 59320)
+++ test/fiddle/test_closure.rb	(revision 59321)
@@ -7,15 +7,15 @@ end https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_closure.rb#L7
 module Fiddle
   class TestClosure < Fiddle::TestCase
     def test_argument_errors
-      assert_raises(TypeError) do
+      assert_raise(TypeError) do
         Closure.new(TYPE_INT, TYPE_INT)
       end
 
-      assert_raises(TypeError) do
+      assert_raise(TypeError) do
         Closure.new('foo', [TYPE_INT])
       end
 
-      assert_raises(TypeError) do
+      assert_raise(TypeError) do
         Closure.new(TYPE_INT, ['meow!'])
       end
     end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]