diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/test/unit/assertions.rb | 3 | ||||
-rw-r--r-- | test/io/console/test_io_console.rb | 4 | ||||
-rw-r--r-- | test/mkmf/test_convertible.rb | 8 | ||||
-rw-r--r-- | test/mkmf/test_signedness.rb | 2 | ||||
-rw-r--r-- | test/pathname/test_pathname.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_notimp.rb | 4 | ||||
-rw-r--r-- | test/ruby/test_pack.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_rand.rb | 2 | ||||
-rw-r--r-- | test/socket/test_addrinfo.rb | 4 |
10 files changed, 20 insertions, 15 deletions
@@ -1,3 +1,7 @@ +Sat Feb 12 23:17:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * lib/test/unit.rb (assert_include): add alias. + Sat Feb 12 14:44:20 2011 Nobuyoshi Nakada <nobu@ruby-lang.org> * thread.c (rb_thread_io_blocking_region): new function to run diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb index 165c72d075..db0679cafb 100644 --- a/lib/test/unit/assertions.rb +++ b/lib/test/unit/assertions.rb @@ -155,7 +155,8 @@ EOT mname = ('assert_not_' << m.to_s[/.*?_(.*)/, 1]) alias_method(mname, m) unless ms.include? mname end - alias assert_no_match assert_not_match + alias assert_include assert_includes + alias assert_not_include assert_not_includes def build_message(head, template=nil, *arguments) template &&= template.chomp diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index 75d8415fce..030dcd38ed 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -117,7 +117,7 @@ class TestIO_Console < Test::Unit::TestCase s.print "a" s.oflush # oflush may be issued after "a" is already sent. s.print "b" - assert_includes(["b", "ab"], m.readpartial(10)) + assert_include(["b", "ab"], m.readpartial(10)) } end @@ -135,7 +135,7 @@ class TestIO_Console < Test::Unit::TestCase s.print "a" s.ioflush # ioflush may be issued after "a" is already sent. s.print "b" - assert_includes(["b", "ab"], m.readpartial(10)) + assert_include(["b", "ab"], m.readpartial(10)) } end diff --git a/test/mkmf/test_convertible.rb b/test/mkmf/test_convertible.rb index 539998a3f4..3ad36b3c6b 100644 --- a/test/mkmf/test_convertible.rb +++ b/test/mkmf/test_convertible.rb @@ -21,10 +21,10 @@ class TestMkmf assert_equal((prefix || signed)+type, mkmf {convertible_int("test1_t", "confdefs.h")}, MKMFLOG) (u = signed[/^u/]) and u.upcase! - assert_includes($defs, "-DTYPEOF_TEST1_T="+"#{prefix||signed}#{type}".quote) - assert_includes($defs, "-DPRI_TEST1T_PREFIX=PRI_#{type.upcase}_PREFIX") - assert_includes($defs, "-DTEST1T2NUM=#{u}#{type.upcase}2NUM") - assert_includes($defs, "-DNUM2TEST1T=NUM2#{u}#{type.upcase}") + assert_include($defs, "-DTYPEOF_TEST1_T="+"#{prefix||signed}#{type}".quote) + assert_include($defs, "-DPRI_TEST1T_PREFIX=PRI_#{type.upcase}_PREFIX") + assert_include($defs, "-DTEST1T2NUM=#{u}#{type.upcase}2NUM") + assert_include($defs, "-DNUM2TEST1T=NUM2#{u}#{type.upcase}") end end end diff --git a/test/mkmf/test_signedness.rb b/test/mkmf/test_signedness.rb index 97fc1078d6..ad0495a2b5 100644 --- a/test/mkmf/test_signedness.rb +++ b/test/mkmf/test_signedness.rb @@ -19,7 +19,7 @@ class TestMkmf } $defs.clear assert_equal(expect.to_i, mkmf {check_signedness("test1_t", "confdefs.h")}, MKMFLOG) - assert_includes($defs, "-DSIGNEDNESS_OF_TEST1_T=#{expect}") + assert_include($defs, "-DSIGNEDNESS_OF_TEST1_T=#{expect}") end end end diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index 86b85b894a..8f2445eacd 100644 --- a/test/pathname/test_pathname.rb +++ b/test/pathname/test_pathname.rb @@ -532,7 +532,7 @@ class TestPathname < Test::Unit::TestCase def test_mountpoint? r = Pathname("/").mountpoint? - assert_includes([true, false], r) + assert_include([true, false], r) end def test_destructive_update diff --git a/test/ruby/test_notimp.rb b/test/ruby/test_notimp.rb index dfe51683c9..c29119eac9 100644 --- a/test/ruby/test_notimp.rb +++ b/test/ruby/test_notimp.rb @@ -3,14 +3,14 @@ require 'tmpdir' class TestNotImplement < Test::Unit::TestCase def test_respond_to_fork - assert_includes(Process.methods, :fork) + assert_include(Process.methods, :fork) if /linux/ =~ RUBY_PLATFORM assert_equal(true, Process.respond_to?(:fork)) end end def test_respond_to_lchmod - assert_includes(File.methods, :lchmod) + assert_include(File.methods, :lchmod) if /linux/ =~ RUBY_PLATFORM assert_equal(false, File.respond_to?(:lchmod)) end diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb index 054fa82567..6ce16a2aa1 100644 --- a/test/ruby/test_pack.rb +++ b/test/ruby/test_pack.rb @@ -139,7 +139,7 @@ class TestPack < Test::Unit::TestCase def test_integer_endian s = [1].pack("s") - assert_includes(["\0\1", "\1\0"], s) + assert_include(["\0\1", "\1\0"], s) if s == "\0\1" _integer_big_endian() else diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb index 5ff2fe5e68..b3dc6959c7 100644 --- a/test/ruby/test_rand.rb +++ b/test/ruby/test_rand.rb @@ -357,7 +357,7 @@ END end v = r.rand(3.1..4) assert_instance_of(Float, v, '[ruby-core:24679]') - assert_includes(3.1..4, v) + assert_include(3.1..4, v) now = Time.now assert_equal(now, r.rand(now..now)) diff --git a/test/socket/test_addrinfo.rb b/test/socket/test_addrinfo.rb index cf6aec30df..c0aeba6f76 100644 --- a/test/socket/test_addrinfo.rb +++ b/test/socket/test_addrinfo.rb @@ -35,7 +35,7 @@ class TestSocketAddrinfo < Test::Unit::TestCase assert_equal(Socket::AF_INET, ai.afamily) assert_equal(Socket::PF_INET, ai.pfamily) assert_equal(Socket::SOCK_STREAM, ai.socktype) - assert_includes([0, Socket::IPPROTO_TCP], ai.protocol) + assert_include([0, Socket::IPPROTO_TCP], ai.protocol) end def test_addrinfo_udp @@ -44,7 +44,7 @@ class TestSocketAddrinfo < Test::Unit::TestCase assert_equal(Socket::AF_INET, ai.afamily) assert_equal(Socket::PF_INET, ai.pfamily) assert_equal(Socket::SOCK_DGRAM, ai.socktype) - assert_includes([0, Socket::IPPROTO_UDP], ai.protocol) + assert_include([0, Socket::IPPROTO_UDP], ai.protocol) end def test_addrinfo_ip_unpack |