require 'spec' require File.dirname(__FILE__) + '/test' module BuildMaster describe 'Site' do before do @system = InMemorySystem.new @cotta = Cotta.new(@system) @root = @cotta.dir('site') end it '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 ==(true) expected_output_file.exists?.should ==(true) end it '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 = <