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

ruby-changes:32193

From: nobu <ko1@a...>
Date: Wed, 18 Dec 2013 13:24:09 +0900 (JST)
Subject: [ruby-changes:32193] nobu:r44272 (trunk): test_io.rb: duplicated test

nobu	2013-12-18 13:24:04 +0900 (Wed, 18 Dec 2013)

  New Revision: 44272

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

  Log:
    test_io.rb: duplicated test
    
    * test/ruby/test_io.rb (test_s_write): merge duplicated test.
    * test/ruby/test_io.rb (test_io_s_write): remove duplicated
      assertsions

  Modified files:
    trunk/test/ruby/test_io.rb
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 44271)
+++ test/ruby/test_io.rb	(revision 44272)
@@ -2566,6 +2566,9 @@ End https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L2566
       assert_equal("\00f", File.read(path))
       assert_equal(1, File.write(path, "f", 0, encoding: "UTF-8"))
       assert_equal("ff", File.read(path))
+      assert_raise(TypeError) {
+        File.write(path, "foo", Object.new => Object.new)
+      }
     end
   end
 
@@ -2968,23 +2971,4 @@ End https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L2971
   ensure
     t.kill
   end
-
-  def test_io_s_write
-    t = Tempfile.new("test_io")
-    t.close
-    path = t.path
-    File.unlink(path)
-    IO.write(path, "foo")
-    assert_equal("foo", IO.read(path))
-    IO.write(path, "bar", 2)
-    assert_equal("fobar", IO.read(path))
-    File.unlink(path)
-    IO.write(path, "foo", encoding: Encoding::UTF_32BE)
-    assert_equal("\0\0\0f\0\0\0o\0\0\0o", File.binread(path))
-    assert_raise(TypeError) {
-      IO.write(path, "foo", Object.new => Object.new)
-    }
-  ensure
-    t.close!
-  end
 end

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

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