Sha256: 9bdc3f803b882839275dcb860283cb527e24c02365cd6a2e7c713a2b76bb561d

Contents?: true

Size: 968 Bytes

Versions: 1

Compression:

Stored size: 968 Bytes

Contents

require File.join(File.dirname(__FILE__), "..", "lib", "staticmatic")

describe StaticMatic::Builder do
  before :each do
    @root_dir  = File.expand_path(File.join(File.dirname(__FILE__), "fixtures", "builder-test"))
    @init_cmd  = File.expand_path(File.join(File.dirname(__FILE__), "..", "bin", "sm-init"))
    @build_cmd = File.expand_path(File.join(File.dirname(__FILE__), "..", "bin", "sm-build"))
    
    `cd #{File.dirname(@root_dir)} && #{@init_cmd} #{File.basename(@root_dir)}`
  end
  
  after :each do
    FileUtils.rm_rf(@root_dir)
  end
  
  it "should build normal files" do
    `cd #{@root_dir} && #{@build_cmd}`
    File.exists?("#{@root_dir}/build/index.html").should_not be_false
  end
  
  it "should not build partial files" do
    File.open("#{@root_dir}/pages/_partial.html.erb", "w") do |f|
      f.puts "Test"
    end
    
    `cd #{@root_dir} && #{@build_cmd}`
    File.exists?("#{@root_dir}/build/_partial.html").should be_false
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tdreyno-staticmatic-2.9.0 spec/builder_spec.rb