require File.join(File.dirname(__FILE__), "..", "lib", "staticmatic") describe StaticMatic::Base do before :all do @sample_site_path = File.dirname(__FILE__) + "/fixtures/sample" @staticmatic = StaticMatic::Base.new(@sample_site_path) end it "should render with layout" do output = @staticmatic.render("hello_world.html") output.should include("My Sample Site") output.should include("Hello world!") end it "should render with layout specified in template" do output = @staticmatic.render("specify_layout") output.should include("This is a Specified Layout") end it "should clean layout variable for next request" do output = @staticmatic.render("specify_layout") @staticmatic.view.instance_variable_get("@layout").should be_nil end it "should allow disabling the layout" do output = @staticmatic.render("no_layout") output.should_not include("My Sample Site") end end