require "test/unit"
require "ogg/vorbis/tagger"
require "fileutils"
-require "open3"
class MainTest < Test::Unit::TestCase
OGG_FILE = "test/test.ogg"
def setup
- tmp =<<EOF
--c "artist=Bolt Thrower" -c "album=...For Victory" -c "date=1994"
-EOF
-
- f = File.open(OGG_FILE, "w")
- cmd = "oggenc -q 0 #{tmp.strip} -r -"
-
- Open3.popen3(cmd) do |sin, sout, _|
- sin.write("\0\0\0\0")
- sin.close
-
- begin
- tmp = sout.read
- f << tmp
- end while !tmp.length.zero?
- end
-
- f.close
+ FileUtils.cp("test/sample.ogg", OGG_FILE)
end
def teardown