Keep the original file mode when writing files.
[ruby-vorbistagger.git] / test / test_main.rb
index 6355e7e9d23fca663d55283d059b51f427a71804..a4a14504d463f1bf3f91786fd7b28445b1f4c97b 100644 (file)
@@ -77,6 +77,16 @@ class MainTest < Test::Unit::TestCase
                end
        end
 
+       def test_write_keeps_file_mode
+               mode = File.stat(OGG_FILE).mode
+
+               Ogg::Vorbis::Tagger.open(OGG_FILE) do |t|
+                       t.write
+               end
+
+               assert_equal(mode, File.stat(OGG_FILE).mode)
+       end
+
        def test_append
                Ogg::Vorbis::Tagger.open(OGG_FILE) do |t|
                        t.comments["genre"] = "Death Metal"