projects
/
ruby-vorbistagger.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Relaxed rules for Ogg::Vorbis::Comments#merge!.
[ruby-vorbistagger.git]
/
test
/
test_main.rb
diff --git
a/test/test_main.rb
b/test/test_main.rb
index 6355e7e9d23fca663d55283d059b51f427a71804..fe622e674a70fd2e1517f595023c40ffc370b04f 100644
(file)
--- a/
test/test_main.rb
+++ b/
test/test_main.rb
@@
-77,6
+77,16
@@
class MainTest < Test::Unit::TestCase
end
end
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"
def test_append
Ogg::Vorbis::Tagger.open(OGG_FILE) do |t|
t.comments["genre"] = "Death Metal"
@@
-240,6
+250,14
@@
EOF
end
end
end
end
+ def test_merge_bad_arg
+ Ogg::Vorbis::Tagger.open(OGG_FILE) do |t|
+ assert_raises(ArgumentError) do
+ t.comments.merge!(42)
+ end
+ end
+ end
+
def test_shift
Ogg::Vorbis::Tagger.open(OGG_FILE) do |t|
assert_equal(["artist", "Bolt Thrower"], t.comments.shift)
def test_shift
Ogg::Vorbis::Tagger.open(OGG_FILE) do |t|
assert_equal(["artist", "Bolt Thrower"], t.comments.shift)
@@
-285,4
+303,9
@@
EOF
ensure
FileUtils.rm_f("test/foo.bar")
end
ensure
FileUtils.rm_f("test/foo.bar")
end
+
+ def test_standalone_comments_object
+ o = Ogg::Vorbis::Comments.new
+ assert_equal(o.length, 0);
+ end
end
end