diff options
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" } |