diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-11-19 08:45:07 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-11-19 08:45:07 +0000 |
commit | f8156e239ea4da4cbcd020f24bf06c4fb9e7cde7 (patch) | |
tree | 31d084283c7e1a9adf98b1754f397c3e7a89f509 /test/test_mogilefs_integration.rb | |
parent | 381044eeda55a5ca7edcccd87d27c30a287723e1 (diff) | |
download | mogilefs-client-f8156e239ea4da4cbcd020f24bf06c4fb9e7cde7.tar.gz |
Destination path will be created with 0600 permissions to be consistent with IO.copy_stream [ruby-core:41151]
Diffstat (limited to 'test/test_mogilefs_integration.rb')
-rw-r--r-- | test/test_mogilefs_integration.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_mogilefs_integration.rb b/test/test_mogilefs_integration.rb index 4bc8e27..18ecd21 100644 --- a/test/test_mogilefs_integration.rb +++ b/test/test_mogilefs_integration.rb @@ -14,6 +14,15 @@ class TestMogileFSIntegration < TestMogIntegration assert_equal "DAT", @client.get_file_data("CRUD", nil, 3) assert_equal "AT", @client.get_file_data("CRUD", nil, 2, 1) + tmp = Tempfile.new("z") + tmp_path = tmp.path + tmp.close! + assert_equal 4, @client.get_file_data("CRUD", tmp_path) + assert_equal "DATA", File.read(tmp_path) + st = File.stat(tmp_path) + assert_equal 0100600, st.mode + File.unlink(tmp_path) + sio = StringIO.new("") rv = @client.get_file_data("CRUD", sio) assert_equal 4, rv |