summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-12 14:17:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-12 14:17:54 +0000
commit7f46fadd9d7f8ee32d9837a67e212f55e23666b8 (patch)
tree33a1f8e8f60c309d3752134ff3c6fea6401b2773
parent58b325366dbc5c84be12fb336ee5e68f208d9365 (diff)
* lib/test/unit.rb (assert_include): add alias.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--lib/test/unit/assertions.rb3
-rw-r--r--test/io/console/test_io_console.rb4
-rw-r--r--test/mkmf/test_convertible.rb8
-rw-r--r--test/mkmf/test_signedness.rb2
-rw-r--r--test/pathname/test_pathname.rb2
-rw-r--r--test/ruby/test_notimp.rb4
-rw-r--r--test/ruby/test_pack.rb2
-rw-r--r--test/ruby/test_rand.rb2
-rw-r--r--test/socket/test_addrinfo.rb4
10 files changed, 20 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 7b2fbda..3983302 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 165c72d..db0679c 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 75d8415..030dcd3 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 539998a..3ad36b3 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 97fc107..ad0495a 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 86b85b8..8f2445e 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 dfe5168..c29119e 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 054fa82..6ce16a2 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 5ff2fe5..b3dc695 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 cf6aec3..c0aeba6 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