diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-18 04:24:04 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-18 04:24:04 +0000 |
commit | 994702424264b23007606a48c5b490e68acf85cb (patch) | |
tree | 252046137552c57732daf49e0a4451432a6d5dfe /test | |
parent | 0e04af526397815ad2a9271d70384927d8ddfc8c (diff) | |
download | ruby-994702424264b23007606a48c5b490e68acf85cb.tar.gz |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_io.rb | 22 |
1 files 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 |