Added Ogg::Vorbis::Comments#merge!.
[ruby-vorbistagger.git] / test / test_main.rb
index 21c4edf662f5ec5056088a63fb5363876a860aa7..be81bb87048ca263bf456854eb0b627553db0f70 100644 (file)
@@ -213,4 +213,21 @@ EOF
                        end
                end
        end
+
+       def test_merge
+               repl = {
+                       "artist" => "Ballista",
+                       "genre" => "Death Metal",
+               }
+
+               Ogg::Vorbis::Tagger.open(OGG_FILE) do |t|
+                       t.comments.merge!(repl)
+
+                       assert_equal(["artist", "album", "date", "genre"],
+                                    t.comments.keys)
+                       assert_equal(["Ballista", "...For Victory", "1994",
+                                     "Death Metal"],
+                                    t.comments.values)
+               end
+       end
 end