mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
Refix #2292
This commit is contained in:
parent
87a95bd0e7
commit
42a074cad9
3 changed files with 39 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
- Always write `deps.yml` if `--track-dependencies` is set and the file doesn't exist
|
||||
- Add `--dependency-file` flag to configure the file location.
|
||||
- Handle the removal of a file in dependencies. Fixes #2292
|
||||
|
||||
# 5.0.0.rc.1
|
||||
|
||||
|
|
|
@ -39,6 +39,43 @@ Feature: Incremental builds
|
|||
| build/standalone.html |
|
||||
And the file "build/standalone.html" should contain "Updated"
|
||||
|
||||
|
||||
Scenario: Removing a file after an initial build should not crash
|
||||
Given an empty app
|
||||
When a file named "config.rb" with:
|
||||
"""
|
||||
"""
|
||||
When a file named "source/layout.erb" with:
|
||||
"""
|
||||
<%= yield %>
|
||||
"""
|
||||
When a file named "source/standalone.html.erb" with:
|
||||
"""
|
||||
Initial
|
||||
"""
|
||||
When a file named "source/other.html.erb" with:
|
||||
"""
|
||||
Some other file
|
||||
"""
|
||||
Then build the app tracking dependencies
|
||||
Then the output should contain "create build/standalone.html"
|
||||
Then the output should contain "create build/other.html"
|
||||
Then the following files should exist:
|
||||
| build/standalone.html |
|
||||
| build/other.html |
|
||||
When I remove the file "source/other.html.erb"
|
||||
Then build app with only changed
|
||||
Then there are "0" files which are created
|
||||
Then there are "0" files which are updated
|
||||
Then there are "1" files which are removed
|
||||
Then the output should contain "skipped build/standalone.html"
|
||||
Then the output should contain "remove build/other.html"
|
||||
Then the following files should exist:
|
||||
| build/standalone.html |
|
||||
Then the following files should not exist:
|
||||
| build/other.html |
|
||||
And the file "deps.yml" should not contain "other.html.erb"
|
||||
|
||||
Scenario: Changing a layout should only rebuild pages which use that layout
|
||||
Given an empty app
|
||||
When a file named "config.rb" with:
|
||||
|
|
|
@ -33,7 +33,7 @@ module Middleman
|
|||
|
||||
Contract Bool
|
||||
def valid?
|
||||
@is_valid = (previous_hash.nil? || hash_file == previous_hash) if @is_valid.nil?
|
||||
@is_valid = ((File.exist? @full_path) && (previous_hash.nil? || hash_file == previous_hash)) if @is_valid.nil?
|
||||
@is_valid
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue