#!/usr/bin/env ruby require 'ftools' require 'rubygems' require_gem 'rtaglib' require 'test/unit' class RtaglibTestCase < Test::Unit::TestCase def initialize(*args) super @original=File.dirname(__FILE__)+"/saw.mp3" end def setup @copy="/tmp/test_"+sprintf("%06d",rand(10000))+".mp3" File.copy(@original,@copy) @file=::TagFile::File.new(@copy) end def teardown File.delete(@copy) end def test_title() @file.title="Saw2" @file.save assert_equal("Saw2",@file.title) end def test_artist() @file.artist="Nobody" @file.save assert_equal("Nobody",@file.artist) end def test_album() @file.album="Dupa" @file.save assert_equal("Dupa",@file.album) end def test_genre() @file.genre="Progressive Rock" @file.save assert_equal("Progressive Rock",@file.genre) end def test_track() @file.track=2 @file.save assert_equal(2,@file.track) end def test_year() @file.year=2010 @file.save assert_equal(2010,@file.year) end def test_comment() @file.comment="New Comment" @file.save assert_equal("New Comment",@file.comment) end end # arch-tag: test