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

ruby-changes:18828

From: nobu <ko1@a...>
Date: Sat, 12 Feb 2011 23:18:06 +0900 (JST)
Subject: [ruby-changes:18828] Ruby:r30853 (trunk): * lib/test/unit.rb (assert_include): add alias.

nobu	2011-02-12 23:17:54 +0900 (Sat, 12 Feb 2011)

  New Revision: 30853

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30853

  Log:
    * lib/test/unit.rb (assert_include): add alias.

  Modified files:
    trunk/ChangeLog
    trunk/lib/test/unit/assertions.rb
    trunk/test/io/console/test_io_console.rb
    trunk/test/mkmf/test_convertible.rb
    trunk/test/mkmf/test_signedness.rb
    trunk/test/pathname/test_pathname.rb
    trunk/test/ruby/test_notimp.rb
    trunk/test/ruby/test_pack.rb
    trunk/test/ruby/test_rand.rb
    trunk/test/socket/test_addrinfo.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30852)
+++ ChangeLog	(revision 30853)
@@ -1,3 +1,7 @@
+Sat Feb 12 23:17:43 2011  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/test/unit.rb (assert_include): add alias.
+
 Sat Feb 12 14:44:20 2011  Nobuyoshi Nakada  <nobu@r...>
 
 	* thread.c (rb_thread_io_blocking_region): new function to run
Index: lib/test/unit/assertions.rb
===================================================================
--- lib/test/unit/assertions.rb	(revision 30852)
+++ lib/test/unit/assertions.rb	(revision 30853)
@@ -155,7 +155,8 @@
         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
Index: test/ruby/test_pack.rb
===================================================================
--- test/ruby/test_pack.rb	(revision 30852)
+++ test/ruby/test_pack.rb	(revision 30853)
@@ -139,7 +139,7 @@
 
   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
Index: test/ruby/test_notimp.rb
===================================================================
--- test/ruby/test_notimp.rb	(revision 30852)
+++ test/ruby/test_notimp.rb	(revision 30853)
@@ -3,14 +3,14 @@
 
 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
Index: test/ruby/test_rand.rb
===================================================================
--- test/ruby/test_rand.rb	(revision 30852)
+++ test/ruby/test_rand.rb	(revision 30853)
@@ -357,7 +357,7 @@
     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))
Index: test/pathname/test_pathname.rb
===================================================================
--- test/pathname/test_pathname.rb	(revision 30852)
+++ test/pathname/test_pathname.rb	(revision 30853)
@@ -532,7 +532,7 @@
 
   def test_mountpoint?
     r = Pathname("/").mountpoint?
-    assert_includes([true, false], r)
+    assert_include([true, false], r)
   end
 
   def test_destructive_update
Index: test/socket/test_addrinfo.rb
===================================================================
--- test/socket/test_addrinfo.rb	(revision 30852)
+++ test/socket/test_addrinfo.rb	(revision 30853)
@@ -35,7 +35,7 @@
     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 @@
     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
Index: test/mkmf/test_signedness.rb
===================================================================
--- test/mkmf/test_signedness.rb	(revision 30852)
+++ test/mkmf/test_signedness.rb	(revision 30853)
@@ -19,7 +19,7 @@
           }
           $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
Index: test/mkmf/test_convertible.rb
===================================================================
--- test/mkmf/test_convertible.rb	(revision 30852)
+++ test/mkmf/test_convertible.rb	(revision 30853)
@@ -21,10 +21,10 @@
           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
Index: test/io/console/test_io_console.rb
===================================================================
--- test/io/console/test_io_console.rb	(revision 30852)
+++ test/io/console/test_io_console.rb	(revision 30853)
@@ -117,7 +117,7 @@
       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 @@
       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
 

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

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