$:.unshift File.join(File.dirname(__FILE__), "..", "..", "lib") require 'spec' require 'buildmaster' require 'buildmaster/cotta' require 'buildmaster/cotta/in_memory_system' module BuildMaster context 'Site Specification' do setup do @cotta = Cotta.new(InMemorySystem.new) end specify 'get relative path' do spec = SiteSpec.new(nil, @cotta) spec.content_dir = '/one/two/content' spec.relative_to_root(@cotta.file('/one/two/content/images/logo.gif')).to_s.should_equal('images/logo.gif') end specify 'supports windows path' do spec = SiteSpec.new(nil, @cotta) spec.content_dir = 'C:\Work\project\content' spec.relative_to_root(@cotta.file('C:\Work\project\content\images\logo.gif')).to_s.should_equal('images/logo.gif') end specify 'initialization with block' do spec = SiteSpec.new(__FILE__, @cotta) do |sitespec| sitespec.content_dir = 'content' sitespec.output_dir = 'output' sitespec.page_layout = <