Sha256: 154132a5633d1246154b3018aa851cad319566e9b5ca77d23de1a9d76bc7940d

Contents?: true

Size: 914 Bytes

Versions: 73

Compression:

Stored size: 914 Bytes

Contents

require 'fileutils'

describe "Generator" do
  def project_file(*parts)
    File.expand_path(File.join(File.dirname(__FILE__), "..", *parts))
  end
  
  before :all do
    @root_dir = project_file("spec", "fixtures", "generator-test")
  end
  
  before :each do
    init_cmd = project_file("bin", "mm-init")
    `cd #{File.dirname(@root_dir)} && #{init_cmd} #{File.basename(@root_dir)}`
  end
  
  after :each do
    FileUtils.rm_rf(@root_dir)
  end
  
  it "should copy template files" do
    template_dir = project_file("lib", "template", "**/*")
    Dir[template_dir].each do |f|
      next if File.directory?(f)
      File.exists?("#{@root_dir}/#{f.split('template/')[1]}").should be_true
    end
  end
  
  it "should create empty directories" do
    %w(views/stylesheets public/stylesheets public/javascripts public/images).each do |d|
      File.exists?("#{@root_dir}/#{d}").should be_true
    end
  end
end

Version data entries

73 entries across 73 versions & 2 rubygems

Version Path
middleman-0.3.3 spec/generator_spec.rb
middleman-0.2.1 spec/generator_spec.rb
middleman-0.2.2 spec/generator_spec.rb
middleman-0.2.3 spec/generator_spec.rb
middleman-0.2.4 spec/generator_spec.rb
middleman-0.2.5 spec/generator_spec.rb
middleman-0.2.6 spec/generator_spec.rb
middleman-0.2.7 spec/generator_spec.rb
middleman-0.2.8 spec/generator_spec.rb
middleman-0.2.9 spec/generator_spec.rb
middleman-0.3.0 spec/generator_spec.rb
middleman-0.3.1 spec/generator_spec.rb
middleman-0.3.2 spec/generator_spec.rb