$:.unshift File.join(File.dirname(__FILE__), "..", "..", "lib") require 'test/unit' require 'buildmaster' module BuildMaster class SiteSpecTest < Test::Unit::TestCase def test_should_get_relative_path spec = SiteSpec.new() spec.content_dir = '/one/two/content' assert_equal('images/logo.gif', spec.relative_to_root('/one/two/content/images/logo.gif').to_s) end def test_should_support_windows_path spec = SiteSpec.new() spec.content_dir = "C:\\Work\\project\\content" assert_equal('images/logo.gif', spec.relative_to_root('C:\\Work\\project\\content\\images\\logo.gif').to_s) end def test_initialize_with_block spec = SiteSpec.new(__FILE__) do |sitespec| sitespec.content_dir = 'content' sitespec.output_dir = 'output' sitespec.page_layout = <