fix clean tests
This commit is contained in:
parent
151c47672e
commit
43e6d669b5
|
@ -2,10 +2,7 @@ Feature: Builder
|
||||||
In order to output static html and css for delivery
|
In order to output static html and css for delivery
|
||||||
|
|
||||||
Scenario: Checking built folder for content
|
Scenario: Checking built folder for content
|
||||||
Given a built app at "test-app"
|
Given a successfully built app at "test-app"
|
||||||
Then a directory named "build" should exist
|
|
||||||
And the exit status should be 0
|
|
||||||
|
|
||||||
When I cd to "build"
|
When I cd to "build"
|
||||||
Then the following files should exist:
|
Then the following files should exist:
|
||||||
| index.html |
|
| index.html |
|
||||||
|
@ -38,10 +35,7 @@ Feature: Builder
|
||||||
And the file "spaces in file.html" should contain "spaces"
|
And the file "spaces in file.html" should contain "spaces"
|
||||||
|
|
||||||
Scenario: Build glob
|
Scenario: Build glob
|
||||||
Given a built app at "glob-app" with flags "--glob '*.css'"
|
Given a successfully built app at "glob-app" with flags "--glob '*.css'"
|
||||||
Then a directory named "build" should exist
|
|
||||||
And the exit status should be 0
|
|
||||||
|
|
||||||
When I cd to "build"
|
When I cd to "build"
|
||||||
Then the following files should not exist:
|
Then the following files should not exist:
|
||||||
| index.html |
|
| index.html |
|
||||||
|
|
|
@ -9,11 +9,7 @@ Feature: Templates should be chainable
|
||||||
And I should see "Sup</h3>"
|
And I should see "Sup</h3>"
|
||||||
|
|
||||||
Scenario: Build chained template
|
Scenario: Build chained template
|
||||||
Given a built app at "chained-app"
|
Given a successfully built app at "chained-app"
|
||||||
|
|
||||||
Then a directory named "build" should exist
|
|
||||||
And the exit status should be 0
|
|
||||||
|
|
||||||
When I cd to "build"
|
When I cd to "build"
|
||||||
Then the following files should exist:
|
Then the following files should exist:
|
||||||
| index.html |
|
| index.html |
|
||||||
|
|
|
@ -1,19 +1,31 @@
|
||||||
Feature: Build Clean
|
Feature: Build Clean
|
||||||
Scenario: Build and Clean an app
|
Scenario: Build and Clean an app
|
||||||
Given app "clean-app" is using config "empty"
|
Given a fixture app "clean-app"
|
||||||
And a built app at "clean-app"
|
And app "clean-app" is using config "empty"
|
||||||
|
And a successfully built app at "clean-app"
|
||||||
And app "clean-app" is using config "complications"
|
And app "clean-app" is using config "complications"
|
||||||
And a built app at "clean-app" with flags "--clean"
|
|
||||||
Then "should_be_ignored.html" should not exist at "clean-app"
|
Given a successfully built app at "clean-app" with flags "--clean"
|
||||||
And "should_be_ignored2.html" should not exist at "clean-app"
|
When I cd to "build"
|
||||||
And "should_be_ignored3.html" should not exist at "clean-app"
|
Then the following files should not exist:
|
||||||
|
| should_be_ignored.html |
|
||||||
|
| should_be_ignored2.html |
|
||||||
|
| should_be_ignored3.html |
|
||||||
|
And the file "index.html" should contain "Comment in layout"
|
||||||
|
|
||||||
Scenario: Clean an app with directory indexes
|
Scenario: Clean an app with directory indexes
|
||||||
Given a built app at "clean-dir-app"
|
Given a successfully built app at "clean-dir-app"
|
||||||
Then "about/index.html" should exist at "clean-dir-app"
|
When I cd to "build"
|
||||||
Given a built app at "clean-dir-app" with flags "--clean"
|
Then the following files should exist:
|
||||||
Then "about/index.html" should exist at "clean-dir-app"
|
| about/index.html |
|
||||||
|
|
||||||
|
Given a successfully built app at "clean-dir-app" with flags "--clean"
|
||||||
|
When I cd to "build"
|
||||||
|
Then the following files should exist:
|
||||||
|
| about/index.html |
|
||||||
|
|
||||||
Scenario: Clean build an app that's never been built
|
Scenario: Clean build an app that's never been built
|
||||||
Given a built app at "clean-dir-app" with flags "--clean"
|
Given a successfully built app at "clean-dir-app" with flags "--clean"
|
||||||
Then "about/index.html" should exist at "clean-dir-app"
|
When I cd to "build"
|
||||||
|
Then the following files should exist:
|
||||||
|
| about/index.html |
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
Feature: Custom Layout Engine
|
Feature: Custom Layout Engine
|
||||||
|
|
||||||
Scenario: Checking built folder for content
|
Scenario: Checking built folder for content
|
||||||
Given a built app at "custom-layout-app"
|
Given a successfully built app at "custom-layout-app"
|
||||||
Then "index.html" should exist at "custom-layout-app" and include "Comment in layout"
|
When I cd to "build"
|
||||||
|
Then the following files should exist:
|
||||||
|
| index.html |
|
||||||
|
And the file "index.html" should contain "Comment in layout"
|
||||||
|
|
||||||
Scenario: Checking server for content
|
Scenario: Checking server for content
|
||||||
Given the Server is running at "test-app"
|
Given the Server is running at "test-app"
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'fileutils'
|
||||||
Given /^app "([^\"]*)" is using config "([^\"]*)"$/ do |path, config_name|
|
Given /^app "([^\"]*)" is using config "([^\"]*)"$/ do |path, config_name|
|
||||||
target = File.join(PROJECT_ROOT_PATH, "fixtures", path)
|
target = File.join(PROJECT_ROOT_PATH, "fixtures", path)
|
||||||
config_path = File.join(target, "config-#{config_name}.rb")
|
config_path = File.join(target, "config-#{config_name}.rb")
|
||||||
config_dest = File.join(target, "config.rb")
|
config_dest = File.join(current_dir, "config.rb")
|
||||||
FileUtils.cp(config_path, config_dest)
|
FileUtils.cp(config_path, config_dest)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -21,28 +21,22 @@ Given /^a built app at "([^\"]*)"$/ do |path|
|
||||||
step %Q{I run `middleman build`}
|
step %Q{I run `middleman build`}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Given /^was successfully built$/ do
|
||||||
|
step %Q{a directory named "build" should exist}
|
||||||
|
step %Q{the exit status should be 0}
|
||||||
|
end
|
||||||
|
|
||||||
|
Given /^a successfully built app at "([^\"]*)"$/ do |path|
|
||||||
|
step %Q{a built app at "#{path}"}
|
||||||
|
step %Q{was successfully built}
|
||||||
|
end
|
||||||
|
|
||||||
Given /^a built app at "([^\"]*)" with flags "([^\"]*)"$/ do |path, flags|
|
Given /^a built app at "([^\"]*)" with flags "([^\"]*)"$/ do |path, flags|
|
||||||
step %Q{a fixture app "#{path}"}
|
step %Q{a fixture app "#{path}"}
|
||||||
step %Q{I run `middleman build #{flags}`}
|
step %Q{I run `middleman build #{flags}`}
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^"([^\"]*)" should exist at "([^\"]*)"$/ do |target_file, path|
|
Given /^a successfully built app at "([^\"]*)" with flags "([^\"]*)"$/ do |path, flags|
|
||||||
target = File.join(PROJECT_ROOT_PATH, "fixtures", path, "build", target_file)
|
step %Q{a built app at "#{path}" with flags "#{flags}"}
|
||||||
File.exists?(target).should be_true
|
step %Q{was successfully built}
|
||||||
end
|
|
||||||
|
|
||||||
Then /^"([^\"]*)" should exist at "([^\"]*)" and include "([^\"]*)"$/ do |target_file, path, expected|
|
|
||||||
target = File.join(PROJECT_ROOT_PATH, "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|
|
|
||||||
target = File.join(PROJECT_ROOT_PATH, "fixtures", path, "build", target_file)
|
|
||||||
File.exists?(target).should be_false
|
|
||||||
end
|
|
||||||
|
|
||||||
Then /^the last exit code should be "([^\"]*)"$/ do |exit_code|
|
|
||||||
exit_code = exit_code.to_i
|
|
||||||
$?.exitstatus.should == exit_code
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue