Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (43 sloc) 1.34 KB
# Code Generated by ZenTest v. 3.6.1
# classname: asrt / meth = ratio%
# Song: 0 / 10 = 0.00%
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
require 'test/unit' unless defined? $ZENTEST and $ZENTEST
require 'song'
class TestSong < Test::Unit::TestCase
def setup
@ts = Song.new
end
def test_class_sub_table_equals
Song.sub_table = {:foo => 'bar'}
assert_equal({:foo => 'bar'}, Song.sub_table)
end
def test_checked_tag
@ts[:test] = 'foo'
assert_equal('bar', @ts.checked_tag(:test, /oo/, lambda {|x,y,z| 'bar'}))
assert_equal('foo', @ts.checked_tag(:test, /oz/, lambda {|x,y,z| 'bar'}))
end
def test_get_canonical_artist
@ts[:artist] = 'Jim, Bob; Ned, featuring Sam'
assert_equal("Bob,Jim,Ned,Sam", @ts.get_canonical_artist)
end
def test_index_equals
@ts[:ext] = 'foo'
assert_nil @ts[:ext]
@ts[:path] = "/usr/bin/test.txt"
assert_equal 'txt', @ts[:ext]
@ts[:length] = '37801'
assert_equal '37801', @ts[:length]
assert_equal '10', @ts[:hours]
assert_equal '30', @ts[:minutes]
assert_equal '1', @ts[:seconds]
@ts[:artist] = ' Bob, Adam'
assert_equal 'Bob, Adam', @ts[:artist]
assert_equal 'Adam,Bob', @ts[:canonical_artist]
end
def test_to_hash
@ts[:foo] = 'bar'
@ts[:baz] = 'bamf'
assert_equal({:foo => 'bar', :baz => 'bamf'}, @ts.to_hash)
end
end
Something went wrong with that request. Please try again.