Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #50 from dudleyf/rake-task-spec

Fix assets:precompile task (with a test, too!)
  • Loading branch information...
commit c0124fba9a4e987b36321501a953967509ebb918 2 parents 0c8afe5 + a2042cf
@wycats wycats authored
Showing with 22 additions and 1 deletion.
  1. +1 −1  lib/rake-pipeline/precompile.rake
  2. +21 −0 spec/rake_tasks_spec.rb
View
2  lib/rake-pipeline/precompile.rake
@@ -2,7 +2,7 @@ namespace :assets do
desc "Precompile assets using Rake::Pipeline"
task :precompile do
config = Rails.application.config.rake_pipeline_assetfile
- Rake::Pipeline::Runner.new(config).invoke
+ Rake::Pipeline::Project.new(config).invoke
end
end
View
21 spec/rake_tasks_spec.rb
@@ -0,0 +1,21 @@
+describe "Rake tasks" do
+ before do
+ @rake = Rake::Application.new
+ Rake.application = @rake
+ end
+
+ describe "assets:precompile" do
+ before do
+ load File.expand_path("../../lib/rake-pipeline/precompile.rake", __FILE__)
+ Rails = double("Rails")
+ Rails.stub_chain(:application, :config, :rake_pipeline_assetfile).and_return("Assetfile")
+ end
+
+ it "creates and invokes a new Project" do
+ project = double("Project")
+ project.should_receive(:invoke)
+ Rake::Pipeline::Project.should_receive(:new).with("Assetfile").and_return(project)
+ @rake["assets:precompile"].invoke
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.