$:.unshift File.join(File.dirname(__FILE__), "..", "lib") require 'xspf' require 'test/unit' class TestParseXSPF < Test::Unit::TestCase def setup @playlist_document = < XSPlF it up! Mayhem & Chaos Coordinator Just a few songs to enjoy while you XSPlF it up! http://mayhem-chaos.net/xspf/xspf_it_up.html http://mayhem-chaos.net/xspf/xspf_it_up/1.0 ihttp://mayhem-chaos.net/xspf/xspf_it_up.html http://musicbrainz.org/track/bdab6db0-2fd6-4166-a5fa-fbf2ff213793 I Wanna Get High Cypress Hill 174613 http://musicbrainz.org/mm-2.1/track/bdab6db0-2fd6-4166-a5fa-fbf2ff213793 bdc846e7-6c26-4193-82a6-8d1b5a4d3429 Smoke Two Joints Sublime 175466 http://musicbrainz.org/mm-2.1/track/bdc846e7-6c26-4193-82a6-8d1b5a4d3429 http://musicbrainz.org/track/7d9776f7-d428-40dc-a425-3c6e3dce4d58 Hash Pipe Weezer 186533 http://musicbrainz.org/mm-2.1/track/7d9776f7-d428-40dc-a425-3c6e3dce4d58 END_OF_PLAYLIST @xspf = XSPF.new(@playlist_document) end def test_class assert_instance_of(XSPF, @xspf) end def test_version assert_equal('1.0', @xspf.version) end def test_encoding assert_equal('UTF-8', @xspf.encoding) end def test_error assert_raise(NoMethodError) {@xspf.inexistent_method } end end