Added common aliases for Ogg::Vorbis::Comments#has_key?.
[ruby-vorbistagger.git] / test / test_main.rb
index cdcf0d8f8a7a13b601502afc34e63741fd40f9ec..ae30dedcb9d54e8c833a2986a668bb0bca469723 100644 (file)
@@ -185,6 +185,10 @@ EOF
                Ogg::Vorbis::Tagger.open(@ogg_buf) do |t|
                        assert(t.comments.has_key?("artist"))
                        assert(!t.comments.has_key?("foo"))
+
+                       assert(t.comments.key?("artist"))
+                       assert(t.comments.include?("artist"))
+                       assert(t.comments.member?("artist"))
                end
        end
 
@@ -207,12 +211,16 @@ EOF
                assert_equal(-1, a <=> b)
        end
 
-       def test_modify_key
+       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