Sha256: 2b795b83ee2e9305d05fa23bfc5caef55deb94863310b3ac54e3aac4db111ed9

Contents?: true

Size: 1.24 KB

Versions: 63

Compression:

Stored size: 1.24 KB

Contents

require 'fileutils'

Given /^generated directory at "([^\"]*)"$/ do |dirname|
  target = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "fixtures", dirname)
  init_cmd = File.expand_path(File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "bin", "middleman init"))
  `cd #{File.dirname(target)} && #{init_cmd} #{File.basename(target)}`
end

Then /^template files should exist at "([^\"]*)"$/ do |dirname|
  target = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "fixtures", dirname)
  template_glob = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "lib", "middleman", "templates", "default", "*/**/*")
  
  Dir[template_glob].each do |f|
    next if File.directory?(f)
    File.exists?("#{target}/#{f.split('template/')[1]}").should be_true
  end
end

Then /^empty directories should exist at "([^\"]*)"$/ do |dirname|
  target = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "fixtures", dirname)
  
  %w(source/stylesheets source/javascripts source/images).each do |d|
    File.exists?("#{target}/#{d}").should be_true
  end
end

Then /^cleanup at "([^\"]*)"$/ do |dirname|
  target = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "fixtures", dirname)
  FileUtils.rm_rf(target)
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
middleman-2.0.16.1-x86-mingw32 features/step_definitions/generator_steps.rb
middleman-2.0.16.1 features/step_definitions/generator_steps.rb
middleman-2.0.16-x86-mingw32 features/step_definitions/generator_steps.rb
middleman-2.0.16 features/step_definitions/generator_steps.rb
middleman-2.0.15.4-x86-mingw32 features/step_definitions/generator_steps.rb
middleman-2.0.15.4 features/step_definitions/generator_steps.rb
middleman-2.0.15.3-x86-mingw32 features/step_definitions/generator_steps.rb
middleman-2.0.15.3 features/step_definitions/generator_steps.rb
middleman-2.0.15.2-x86-mingw32 features/step_definitions/generator_steps.rb
middleman-2.0.15.2 features/step_definitions/generator_steps.rb
middleman-2.0.15.1-x86-mingw32 features/step_definitions/generator_steps.rb
middleman-2.0.15.1 features/step_definitions/generator_steps.rb
middleman-2.0.15-x86-mingw32 features/step_definitions/generator_steps.rb
middleman-2.0.15 features/step_definitions/generator_steps.rb
middleman-3.0.0.alpha.2 features/step_definitions/generator_steps.rb
middleman-2.0.14-x86-mingw32 features/step_definitions/generator_steps.rb
middleman-2.0.14 features/step_definitions/generator_steps.rb
middleman-2.0.14.pre2-x86-mingw32 features/step_definitions/generator_steps.rb
middleman-2.0.14.pre2 features/step_definitions/generator_steps.rb
middleman-2.0.13.2-x86-mingw32 features/step_definitions/generator_steps.rb