Split MainTest#test_modify_key into two smaller tests.
[ruby-vorbistagger.git] / test / test_main.rb
index da3621cc3ef3c159164ea2d811775a6ac9bca0dd..5c6457b8c54a181fff35c680428767f5f9b3f440 100644 (file)
@@ -206,4 +206,22 @@ EOF
                b["artist"] = "Foo"
                assert_equal(-1, a <=> b)
        end
+
+       def test_modify_existing_key
+               Ogg::Vorbis::Tagger.open(@ogg_buf) do |t|
+                       assert_raises(TypeError) do
+                               t.comments.keys.first.replace("new")
+                       end
+               end
+       end
+
+       def test_modify_added_key
+               Ogg::Vorbis::Tagger.open(@ogg_buf) do |t|
+                       t.comments["Foo"] = "Bar"
+
+                       assert_raises(TypeError) do
+                               t.comments.keys.last.replace("new")
+                       end
+               end
+       end
 end