summaryrefslogtreecommitdiff
path: root/test/pathname
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-04 11:12:12 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-04 11:12:12 +0000
commitc3d1fde2b528413f5be2f936a9d7ea899a777fc7 (patch)
tree18b6a1f8f5240b12b6325eb2222f6939522ff500 /test/pathname
parent12bf1de1dda78e8fb69d7cc1dda24e7e09eb8806 (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.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index ccdc5bd..ec9dfa1 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" }