diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-04 11:12:12 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-04 11:12:12 +0000 |
commit | c3d1fde2b528413f5be2f936a9d7ea899a777fc7 (patch) | |
tree | 18b6a1f8f5240b12b6325eb2222f6939522ff500 /test/pathname | |
parent | 12bf1de1dda78e8fb69d7cc1dda24e7e09eb8806 (diff) |
* ext/pathname/pathname.c (path_write): New method.
(path_binwrite): Ditto.
[ruby-core:49468] [Feature #7378]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/pathname')
-rw-r--r-- | test/pathname/test_pathname.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index ccdc5bd8eb..ec9dfa1d59 100644 --- a/test/pathname/test_pathname.rb +++ b/test/pathname/test_pathname.rb @@ -716,6 +716,22 @@ class TestPathname < Test::Unit::TestCase } end + def test_write + with_tmpchdir('rubytest-pathname') {|dir| + path = Pathname("a") + path.write "abc" + assert_equal("abc", path.read) + } + end + + def test_binwrite + with_tmpchdir('rubytest-pathname') {|dir| + path = Pathname("a") + path.binwrite "abc\x80" + assert_equal("abc\x80".b, path.binread) + } + end + def test_sysopen with_tmpchdir('rubytest-pathname') {|dir| open("a", "w") {|f| f.write "abc" } |