Sha256: 823661dd6db512cf4cdf402b041ced11f73578c7810468dc94416ffbc82f27b9

Contents?: true

Size: 1.53 KB

Versions: 32

Compression:

Stored size: 1.53 KB

Contents

require 'fileutils'

Given /^a built app at "([^"]*)"$/ do |path|
  root = File.dirname(File.dirname(File.dirname(__FILE__)))
  target = File.join(root, "fixtures", path)
  build_cmd = File.expand_path(File.join(root, "bin", "middleman build"))
  `cd #{target} && #{build_cmd}`
end

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

Given /^a built app at "([^"]*)" with flags "([^"]*)"$/ do |path, flags|
  root = File.dirname(File.dirname(File.dirname(__FILE__)))
  target = File.join(root, "fixtures", path)
  build_cmd = File.expand_path(File.join(root, "bin", "middleman build"))
  `cd #{target} && #{build_cmd} #{flags}`
end

Then /^"([^"]*)" should exist at "([^"]*)"$/ do |target_file, path|
  root = File.dirname(File.dirname(File.dirname(__FILE__)))
  target = File.join(root, "fixtures", path, "build", target_file)
  File.exists?(target).should be_true
end

Then /^"([^"]*)" should exist at "([^"]*)" and include "([^"]*)"$/ do |target_file, path, expected|
  root = File.dirname(File.dirname(File.dirname(__FILE__)))
  target = File.join(root, "fixtures", path, "build", target_file)
  File.exists?(target).should be_true
  File.read(target).should include(expected)
end

Then /^"([^"]*)" should not exist at "([^"]*)"$/ do |target_file, path|
  root = File.dirname(File.dirname(File.dirname(__FILE__)))
  target = File.join(root, "fixtures", path, "build", target_file)
  File.exists?(target).should be_false
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
middleman-2.0.12-x86-mingw32 features/step_definitions/builder_steps.rb
middleman-2.0.12 features/step_definitions/builder_steps.rb
middleman-2.0.12.pre-x86-mingw32 features/step_definitions/builder_steps.rb
middleman-2.0.12.pre features/step_definitions/builder_steps.rb
middleman-2.0.11 features/step_definitions/builder_steps.rb
middleman-2.0.11-x86-mingw32 features/step_definitions/builder_steps.rb
middleman-2.0.11.pre-x86-mingw32 features/step_definitions/builder_steps.rb
middleman-2.0.11.pre features/step_definitions/builder_steps.rb
middleman-2.0.10-x86-mingw32 features/step_definitions/builder_steps.rb
middleman-2.0.10 features/step_definitions/builder_steps.rb
middleman-2.0.9-x86-mingw32 features/step_definitions/builder_steps.rb
middleman-2.0.9 features/step_definitions/builder_steps.rb
middleman-2.0.9.pre.3-x86-mingw32 features/step_definitions/builder_steps.rb
middleman-2.0.9.pre.3 features/step_definitions/builder_steps.rb
middleman-2.0.9.pre.2-x86-mingw32 features/step_definitions/builder_steps.rb
middleman-2.0.9.pre.2 features/step_definitions/builder_steps.rb
middleman-2.0.9.pre-x86-mswin32 features/step_definitions/builder_steps.rb
middleman-2.0.9.pre features/step_definitions/builder_steps.rb
middleman-2.0.8 features/step_definitions/builder_steps.rb
middleman-2.0.7 features/step_definitions/builder_steps.rb