Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add failing test

  • Loading branch information...
commit ea7a33df99ba6cf36f7ab6412b90c7416be2b07d 1 parent 082e4c2
twinturbo authored
Showing with 68 additions and 9 deletions.
  1. +0 −8 spec/pipeline_spec.rb
  2. +68 −1 spec/rake_acceptance_spec.rb
View
8 spec/pipeline_spec.rb
@@ -159,14 +159,6 @@ def setup_roots
pipeline.input_files.should == files
end
- it "raise an error when inputs are temporary_files" do
- pipeline.input_files = [input_file("foo.bar", pipeline.tmpdir)]
-
- expect {
- pipeline.invoke
- }.to raise_error(Rake::Pipeline::TmpInputError)
- end
-
it "configures the filters with outputs and inputs with #rake_tasks" do
concat = ConcatFilter.new
concat.output_name_generator = proc { |input| "javascripts/application.js" }
View
69 spec/rake_acceptance_spec.rb
@@ -619,8 +619,75 @@ def output_should_exist(expected=EXPECTED_JS_OUTPUT)
end
end
- project.invoke_clean
+ project.invoke
output_should_exist
end
+
+ describe "Handling mistakes" do
+ it "should raise an error when the tmp dir is added directly" do
+ project = Rake::Pipeline::Project.build do
+ output "public"
+ tmpdir "app"
+
+ input "app", "**/*" do
+ concat "tmp.js"
+ end
+ end
+
+ expect {
+ project.invoke ; project.invoke
+ }.to raise_error(Rake::Pipeline::TmpInputError)
+ end
+
+ it "should raise an error when the tmp dir is matched" do
+ project = Rake::Pipeline::Project.build do
+ output "public"
+ tmpdir "app/tmp"
+
+ input "app" do
+ # to generate temporary files
+ # which can be matched in the second invocation
+ match "**/*.js" do
+ concat "app.js"
+ end
+
+ match "tmp/**/*" do
+ concat "tmp.js"
+ end
+ end
+ end
+
+ expect {
+ project.invoke ; project.invoke
+ }.to raise_error(Rake::Pipeline::TmpInputError)
+ end
+
+ it "should not raise an error for internal temporary files" do
+ # Create a project with multiple filters and build
+ # steps to create intermediate build files
+ project = Rake::Pipeline::Project.build do
+ output "public"
+ tmpdir "temporary"
+
+ input tmp, "app/**/*" do
+ match "*.js" do
+ concat "application.js"
+ end
+
+ match "*.css" do
+ concat "application.css"
+ end
+
+ match "*.{js,css}" do
+ concat "every_file.application"
+ end
+ end
+ end
+
+ expect {
+ project.invoke
+ }.to_not raise_error(Rake::Pipeline::TmpInputError)
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.