$:.unshift File.join(File.dirname(__FILE__), "..", "..", '..', "lib") require 'spec' require 'buildmaster' require 'buildmaster/cotta' require 'buildmaster/cotta/in_memory_system' module BuildMaster context 'Site' do setup do @system = InMemorySystem.new @cotta = Cotta.new(@system) @root = @cotta.dir('site') end specify 'should build base on content' do content_dir = @root.dir('content') content_dir.file('index.html').save(<

Text

CONTENT ) content_dir.file('markdown.markdown').save(< Title TEMPLATE site = Site.new(spec) site.build expected_output_file = @root.dir('output').file('index.html') @root.exists?.should_equal(true) expected_output_file.exists?.should_equal(true) end specify 'ignore the svn and CVS directories' do content_dir = @root.dir('content') content_dir.dir('.svn').mkdirs content_dir.dir('_svn').mkdirs content_dir.dir('CVS').mkdirs spec = SiteSpec.new(nil, @cotta) spec.output_dir = 'site/output' spec.content_dir = 'site/content' spec.template = <