Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add failing test for deleting dynamic dependencies #133

Merged
merged 1 commit into from

2 participants

@ahawkins

Found in ember's build process.

twinturbo Add failing test for deleting dynamic dependencies
Found in ember's build process.
c80c03f
@wycats wycats merged commit 65b1e74 into livingsocial:master

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 21, 2013
  1. Add failing test for deleting dynamic dependencies

    twinturbo authored
    Found in ember's build process.
This page is out of date. Refresh to see the latest.
View
4 lib/rake-pipeline/manifest.rb
@@ -59,6 +59,10 @@ def []=(key, value)
@entries[key] = value
end
+ def clear
+ entries.clear
+ end
+
def empty?
entries.empty?
end
View
5 lib/rake-pipeline/project.rb
@@ -132,6 +132,7 @@ def invoke
# Remove the project's temporary and output files.
def clean
+ last_manifest.clear
files_to_clean.each { |file| FileUtils.rm_rf(file) }
end
@@ -273,7 +274,7 @@ def digest(str)
end
def dirty?
- assetfile_dirty? || files_dirty? || files_deleted?
+ assetfile_dirty? || files_deleted? || files_dirty?
end
def assetfile_dirty?
@@ -307,7 +308,7 @@ def files_dirty?
end
def files_deleted?
- manifest.files.each_key do |input_file|
+ last_manifest.files.each_key do |input_file|
return true if !File.exists?(input_file)
end
View
18 spec/rake_acceptance_spec.rb
@@ -586,6 +586,24 @@ def delete_files
content.should == "true to trance"
end
+ it "should handle dynamic dependencies being deleted" do
+ project.invoke
+
+ content = File.read output_file
+
+ content.should == EXPECTED_DYNAMIC_OUTPUT
+
+ sleep 1
+
+ imported_file = File.join tmp, "variables.import"
+
+ File.exists?(imported_file).should be_true
+
+ FileUtils.rm_rf imported_file
+
+ project.invoke
+ end
+
it "should not regenerate files when nothing changes" do
project.invoke
previous_mtime = File.mtime output_file
View
2  spec/support/spec_helpers/filters.rb
@@ -20,7 +20,7 @@ def additional_dependencies(input)
def includes(input)
input.read.scan(/^@import\(\"(.*)\"\)$/).map(&:first).map do |inc|
File.join(input.root, "#{inc}.import")
- end
+ end.select { |f| File.exists? f }
end
def generate_output(inputs, output)
Something went wrong with that request. Please try again.