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

ruby-changes:8060

From: knu <ko1@a...>
Date: Fri, 26 Sep 2008 18:57:42 +0900 (JST)
Subject: [ruby-changes:8060] Ruby:r19585 (trunk): * test/pathname/test_pathname.rb: Fix use of deprecated methods.

knu	2008-09-26 18:57:33 +0900 (Fri, 26 Sep 2008)

  New Revision: 19585

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

  Log:
    * test/pathname/test_pathname.rb: Fix use of deprecated methods.

  Modified files:
    trunk/test/pathname/test_pathname.rb

Index: test/pathname/test_pathname.rb
===================================================================
--- test/pathname/test_pathname.rb	(revision 19584)
+++ test/pathname/test_pathname.rb	(revision 19585)
@@ -257,17 +257,17 @@
   defassert(:relative_path_from, "a", "a", "b/..")
   defassert(:relative_path_from, "b/c", "b/c", "b/..")
 
-  def self.defassert_raise(name, exc, *args)
+  def self.defassert_raises(name, exc, *args)
     define_assertion(name) {
       message = "#{name}(#{args.map {|a| a.inspect }.join(', ')})"
-      assert_raise(exc, message) { self.send(name, *args) }
+      assert_raises(exc, message) { self.send(name, *args) }
     }
   end
 
-  defassert_raise(:relative_path_from, ArgumentError, "/", ".")
-  defassert_raise(:relative_path_from, ArgumentError, ".", "/")
-  defassert_raise(:relative_path_from, ArgumentError, "a", "..")
-  defassert_raise(:relative_path_from, ArgumentError, ".", "..")
+  defassert_raises(:relative_path_from, ArgumentError, "/", ".")
+  defassert_raises(:relative_path_from, ArgumentError, ".", "/")
+  defassert_raises(:relative_path_from, ArgumentError, "a", "..")
+  defassert_raises(:relative_path_from, ArgumentError, ".", "..")
 
   def realpath(path)
     Pathname.new(path).realpath.to_s
@@ -282,9 +282,9 @@
     end
     Dir.mktmpdir('rubytest-pathname') {|dir|
       File.symlink("not-exist-target", "#{dir}/not-exist")
-      assert_raise(Errno::ENOENT) { realpath("#{dir}/not-exist") }
+      assert_raises(Errno::ENOENT) { realpath("#{dir}/not-exist") }
       File.symlink("loop", "#{dir}/loop")
-      assert_raise(Errno::ELOOP) { realpath("#{dir}/loop") }
+      assert_raises(Errno::ELOOP) { realpath("#{dir}/loop") }
     }
   end
 
@@ -314,7 +314,7 @@
   end
 
   def test_initialize_nul
-    assert_raise(ArgumentError) { Pathname.new("a\0") }
+    assert_raises(ArgumentError) { Pathname.new("a\0") }
   end
 
   class AnotherStringLike # :nodoc:
@@ -409,7 +409,7 @@
   end
 
   def test_null_character
-    assert_raise(ArgumentError) { Pathname.new("\0") }
+    assert_raises(ArgumentError) { Pathname.new("\0") }
   end
 
   def test_taint
@@ -462,8 +462,8 @@
     str = "a"
     obj = Pathname.new(str)
     assert_equal(str, obj.to_s)
-    assert_not_same(str, obj.to_s)
-    assert_not_same(obj.to_s, obj.to_s)
+    refute_same(str, obj.to_s)
+    refute_same(obj.to_s, obj.to_s)
   end
 
   def test_kernel_open

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

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