projects
/
ruby-vorbistagger.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d9c71be
)
Added tests that ensure sane behaviour with non-existing/invalid files.
author
Tilman Sauerbeck
<tilman@code-monkey.de>
Thu, 17 Aug 2006 15:30:28 +0000
(17:30 +0200)
committer
Tilman Sauerbeck
<tilman@code-monkey.de>
Wed, 23 Aug 2006 17:39:15 +0000
(19:39 +0200)
test/test_main.rb
patch
|
blob
|
history
diff --git
a/test/test_main.rb
b/test/test_main.rb
index bbc5b0023a2987e31af883c4573dde96f4605dd5..6da6d6dd556d90920819c3fa914d3032b89f428c 100644
(file)
--- a/
test/test_main.rb
+++ b/
test/test_main.rb
@@
-252,4
+252,22
@@
EOF
def test_close
Ogg::Vorbis::Tagger.new(OGG_FILE).close
end
+
+ def test_open_non_existing_file
+ assert_raises(Ogg::Vorbis::Tagger::OpenError) do
+ Ogg::Vorbis::Tagger.new("foo.bar")
+ end
+ end
+
+ def test_open_non_ogg_file
+ File.open("test/foo.bar", "w") do |f|
+ f << "foobarbazxyzzy"
+ end
+
+ assert_raises(Ogg::Vorbis::Tagger::InvalidDataError) do
+ Ogg::Vorbis::Tagger.new("test/foo.bar")
+ end
+ ensure
+ FileUtils.rm_f("test/foo.bar")
+ end
end