$:.unshift File.join(File.dirname(__FILE__), "..", "..", '..', "lib") require 'test/unit' require 'buildmaster' module BuildMaster class SiteTest < Test::Unit::TestCase protected def setup super @temp = File.join(File.dirname(__FILE__), '..', '..', 'tmp') if (File.exist? @temp) delete_all(@temp) end end private def delete_all(directory) Dir.foreach(directory) do |name| if (name != '.' && name != '..') file = File.join(directory, name) if (File.directory? file) delete_all(file) else File.delete(file) end end end Dir.rmdir(directory) end public def test_should_build_based_on_content spec = SiteSpec.new spec.output_dir = File.join(@temp, 'output') spec.content_dir = File.join(File.dirname(__FILE__), 'content') spec.template =<