2012-01-07 01:40:28 -05:00
|
|
|
Feature: Ignoring paths
|
2012-04-04 13:26:07 -04:00
|
|
|
Scenario: Ignore a single path (build)
|
2012-01-07 01:40:28 -05:00
|
|
|
Given a fixture app "ignore-app"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
ignore 'about.html.erb'
|
|
|
|
ignore 'plain.html'
|
|
|
|
"""
|
|
|
|
And a successfully built app at "ignore-app"
|
|
|
|
Then the following files should exist:
|
|
|
|
| build/index.html |
|
|
|
|
And the following files should not exist:
|
|
|
|
| build/plain.html |
|
|
|
|
| build/about.html |
|
2016-01-02 20:37:11 -05:00
|
|
|
|
2012-04-04 13:26:07 -04:00
|
|
|
Scenario: Ignore a single path (server)
|
|
|
|
Given a fixture app "ignore-app"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
ignore 'about.html.erb'
|
|
|
|
ignore 'plain.html'
|
|
|
|
"""
|
|
|
|
And the Server is running
|
|
|
|
When I go to "/index.html"
|
|
|
|
Then I should not see "File Not Found"
|
|
|
|
When I go to "/plain.html"
|
|
|
|
Then I should see "File Not Found"
|
|
|
|
When I go to "/about.html"
|
|
|
|
Then I should see "File Not Found"
|
2012-01-07 01:40:28 -05:00
|
|
|
|
2016-01-02 20:37:11 -05:00
|
|
|
Scenario: Ignoring collected values
|
|
|
|
Given a fixture app "ignore-app"
|
|
|
|
And a file named "data/ignores.yaml" with:
|
|
|
|
"""
|
|
|
|
---
|
|
|
|
- "plain"
|
|
|
|
"""
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
data.ignores.each do |name|
|
|
|
|
ignore "#{name}.html"
|
|
|
|
end
|
|
|
|
"""
|
|
|
|
And the Server is running
|
|
|
|
When I go to "/plain.html"
|
|
|
|
Then I should see "File Not Found"
|
|
|
|
When I go to "/about.html"
|
|
|
|
Then I should not see "File Not Found"
|
|
|
|
|
|
|
|
When the file "data/ignores.yaml" has the contents
|
|
|
|
"""
|
|
|
|
---
|
|
|
|
- "about"
|
|
|
|
"""
|
|
|
|
When I go to "/plain.html"
|
|
|
|
Then I should not see "File Not Found"
|
|
|
|
When I go to "/about.html"
|
|
|
|
Then I should see "File Not Found"
|
|
|
|
|
2012-04-04 13:26:07 -04:00
|
|
|
Scenario: Ignore a globbed path (build)
|
2012-01-07 01:40:28 -05:00
|
|
|
Given a fixture app "ignore-app"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
ignore '*.erb'
|
|
|
|
ignore 'reports/*'
|
|
|
|
ignore 'images/**/*.png'
|
|
|
|
"""
|
|
|
|
And a successfully built app at "ignore-app"
|
|
|
|
Then the following files should exist:
|
|
|
|
| build/plain.html |
|
|
|
|
| build/images/portrait.jpg |
|
2012-01-14 17:09:20 -05:00
|
|
|
| build/images/pic.png |
|
2012-01-07 01:40:28 -05:00
|
|
|
And the following files should not exist:
|
|
|
|
| build/about.html |
|
|
|
|
| build/index.html |
|
|
|
|
| build/reports/index.html |
|
|
|
|
| build/reports/another.html |
|
|
|
|
| build/images/icons/messages.png |
|
2016-01-02 20:37:11 -05:00
|
|
|
|
2012-04-04 13:26:07 -04:00
|
|
|
Scenario: Ignore a globbed path (server)
|
|
|
|
Given a fixture app "ignore-app"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
ignore '*.erb'
|
|
|
|
ignore 'reports/*'
|
|
|
|
ignore 'images/**/*.png'
|
|
|
|
"""
|
|
|
|
And the Server is running
|
|
|
|
When I go to "/plain.html"
|
|
|
|
Then I should not see "File Not Found"
|
|
|
|
When I go to "/images/portrait.jpg"
|
|
|
|
Then I should not see "File Not Found"
|
|
|
|
When I go to "/images/pic.png"
|
|
|
|
Then I should not see "File Not Found"
|
|
|
|
When I go to "/about.html"
|
|
|
|
Then I should see "File Not Found"
|
|
|
|
When I go to "/index.html"
|
|
|
|
Then I should see "File Not Found"
|
|
|
|
When I go to "/reports/index.html"
|
|
|
|
Then I should see "File Not Found"
|
|
|
|
When I go to "/reports/another.html"
|
|
|
|
Then I should see "File Not Found"
|
|
|
|
When I go to "/images/icons/messages.png"
|
|
|
|
Then I should see "File Not Found"
|
2012-01-07 01:40:28 -05:00
|
|
|
|
2012-04-04 13:26:07 -04:00
|
|
|
Scenario: Ignore a regex (build)
|
2012-03-24 23:27:55 -04:00
|
|
|
Given a fixture app "ignore-app"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
ignore /^.*\.erb/
|
|
|
|
ignore /^reports\/.*/
|
|
|
|
ignore /^images\.*\.png/
|
|
|
|
"""
|
|
|
|
And a successfully built app at "ignore-app"
|
|
|
|
Then the following files should exist:
|
|
|
|
| build/plain.html |
|
|
|
|
| build/images/portrait.jpg |
|
|
|
|
| build/images/pic.png |
|
|
|
|
And the following files should not exist:
|
|
|
|
| build/about.html |
|
|
|
|
| build/index.html |
|
|
|
|
| build/reports/index.html |
|
|
|
|
| build/reports/another.html |
|
|
|
|
| build/images/icons/messages.png |
|
2016-01-02 20:37:11 -05:00
|
|
|
|
2012-04-04 13:26:07 -04:00
|
|
|
Scenario: Ignore a regex (server)
|
|
|
|
Given a fixture app "ignore-app"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
ignore /^.*\.erb/
|
|
|
|
ignore /^reports\/.*/
|
|
|
|
ignore /^images\.*\.png/
|
|
|
|
"""
|
|
|
|
And the Server is running
|
|
|
|
When I go to "/plain.html"
|
|
|
|
Then I should not see "File Not Found"
|
|
|
|
When I go to "/images/portrait.jpg"
|
|
|
|
Then I should not see "File Not Found"
|
|
|
|
When I go to "/images/pic.png"
|
|
|
|
Then I should not see "File Not Found"
|
|
|
|
When I go to "/about.html"
|
|
|
|
Then I should see "File Not Found"
|
|
|
|
When I go to "/index.html"
|
|
|
|
Then I should see "File Not Found"
|
|
|
|
When I go to "/reports/index.html"
|
|
|
|
Then I should see "File Not Found"
|
|
|
|
When I go to "/reports/another.html"
|
|
|
|
Then I should see "File Not Found"
|
|
|
|
When I go to "/images/icons/messages.png"
|
2016-01-02 20:37:11 -05:00
|
|
|
Then I should see "File Not Found"
|