[/musicextras/musicextras: changeset 42 Zachary P. Landau **20041018031846 Added support for running plugin tests with -T ] { hunk ./lib/musicextras/musicsite.rb 158 + def self.run_tests + @@plugins.each do |t| + plugin = MusicExtras.const_get(t.to_s) + results = plugin.new.test + yield([plugin.to_s.split('::')[1], results[0], results[1]]) + end + end + hunk ./lib/musicextras/musicsite.rb 267 + end + + ## If plugin passes, returns an array of [true, []] + ## If plugin failes, returns an array of [false, msgs] where msgs is an + ## array of strings describing the failed tests + ## If plugin doesn't implement tests, don't override this + def test + [nil, []] hunk ./lib/musicextras/pusher.rb 92 - MusicSite::run_tests do |name, passed, msg| + @options.plugins.each do |plugin| + passed, msg = MusicExtras.const_get(plugin).new.test() hunk ./lib/musicextras/pusher.rb 102 - puts "\t* %-20s [%s]" % [name, info] + puts "\t* %-20s [%s]" % [plugin, info] hunk ./lib/musicextras/pusher.rb 321 - # XXX: yeah, so, fuck threads. if i run this shit in a thread, the program just - # quits somewhere in song.lyrics. no error or anything. so fuck threads. - }