From 994702424264b23007606a48c5b490e68acf85cb Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 18 Dec 2013 04:24:04 +0000 Subject: [PATCH] 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 6af318c706..a6f2b14abe 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2566,6 +2566,9 @@ End 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 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