diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-13 09:46:16 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-13 09:46:16 +0000 |
commit | 24873d1a0520ceef39c1c492c6b02dbbc186d8ff (patch) | |
tree | b9932565137a7c95ed43e28ef43154e92c962eb3 /test/fiddle | |
parent | 52e8254b548a06c67fc1c130040925d169b8d2b0 (diff) | |
download | bundler-24873d1a0520ceef39c1c492c6b02dbbc186d8ff.tar.gz |
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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/fiddle')
-rw-r--r-- | test/fiddle/helper.rb | 4 | ||||
-rw-r--r-- | test/fiddle/test_closure.rb | 6 | ||||
-rw-r--r-- | test/fiddle/test_cparser.rb | 4 | ||||
-rw-r--r-- | test/fiddle/test_func.rb | 2 | ||||
-rw-r--r-- | test/fiddle/test_function.rb | 2 | ||||
-rw-r--r-- | test/fiddle/test_handle.rb | 2 | ||||
-rw-r--r-- | test/fiddle/test_import.rb | 2 | ||||
-rw-r--r-- | test/fiddle/test_pointer.rb | 2 |
8 files changed, 9 insertions, 15 deletions
diff --git a/test/fiddle/helper.rb b/test/fiddle/helper.rb index 461f1878a8..d1bbe24b74 100644 --- a/test/fiddle/helper.rb +++ b/test/fiddle/helper.rb @@ -1,5 +1,5 @@ # 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 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) diff --git a/test/fiddle/test_closure.rb b/test/fiddle/test_closure.rb index 0e3574ff84..0dbdcb3138 100644 --- a/test/fiddle/test_closure.rb +++ b/test/fiddle/test_closure.rb @@ -7,15 +7,15 @@ end 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 diff --git a/test/fiddle/test_cparser.rb b/test/fiddle/test_cparser.rb index 16134f5aa7..c1527bf85d 100644 --- a/test/fiddle/test_cparser.rb +++ b/test/fiddle/test_cparser.rb @@ -61,7 +61,7 @@ module Fiddle 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 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 diff --git a/test/fiddle/test_func.rb b/test/fiddle/test_func.rb index 5cdf90f567..70e1b9e333 100644 --- a/test/fiddle/test_func.rb +++ b/test/fiddle/test_func.rb @@ -13,7 +13,7 @@ module Fiddle 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) diff --git a/test/fiddle/test_function.rb b/test/fiddle/test_function.rb index 06d0eb2b50..3cce95a540 100644 --- a/test/fiddle/test_function.rb +++ b/test/fiddle/test_function.rb @@ -6,8 +6,6 @@ end module Fiddle class TestFunction < Fiddle::TestCase - include Test::Unit::Assertions - def setup super Fiddle.last_error = nil diff --git a/test/fiddle/test_handle.rb b/test/fiddle/test_handle.rb index edbfbb3e6e..233e8b0aa4 100644 --- a/test/fiddle/test_handle.rb +++ b/test/fiddle/test_handle.rb @@ -8,8 +8,6 @@ module Fiddle class TestHandle < TestCase include Fiddle - include Test::Unit::Assertions - def test_safe_handle_open t = Thread.new do $SAFE = 1 diff --git a/test/fiddle/test_import.rb b/test/fiddle/test_import.rb index 25819fbc46..b637e4fadd 100644 --- a/test/fiddle/test_import.rb +++ b/test/fiddle/test_import.rb @@ -45,7 +45,7 @@ module Fiddle 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*)" diff --git a/test/fiddle/test_pointer.rb b/test/fiddle/test_pointer.rb index aa77c619ef..80b64b04db 100644 --- a/test/fiddle/test_pointer.rb +++ b/test/fiddle/test_pointer.rb @@ -10,8 +10,6 @@ module Fiddle Fiddle.dlwrap arg end - include Test::Unit::Assertions - def test_cptr_to_int null = Fiddle::NULL assert_equal(null.to_i, null.to_int) |