Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

NoopPackager should never run.

  • Loading branch information...
commit ccfa677278337e7db0d5adbc59d8e47a9c585a9f 1 parent c45df04
@gabebw gabebw authored
View
11 features/kumade_executable.feature
@@ -5,13 +5,8 @@ Feature: Kumade executable
So I can have a better experience than Rake provides
Background:
- Given a directory named "executable"
- And I cd to "executable"
- And I set up the Gemfile with kumade
- And I add "jammit" to the Gemfile
- And I bundle
- When I set up a git repo
- And I create a Heroku remote named "pretend-staging"
+ Given a new Rails application with Kumade and Jammit
+ When I create a Heroku remote named "pretend-staging"
And I create a Heroku remote named "staging"
And I create a non-Heroku remote named "bad-remote"
@@ -46,7 +41,7 @@ Feature: Kumade executable
Then the output should match /==> ! Cannot deploy: "bad-remote" remote does not point to Heroku/
Scenario: Deploy from a branch that isn't "master"
- When I run `git checkout -b new_branch`
+ When I switch to the "new_branch" branch
And I run kumade with "pretend-staging -p"
Then the output should contain "==> Pushed new_branch -> origin"
And the output should contain "==> Deployed to: pretend-staging"
View
8 features/kumade_without_jammit.feature
@@ -2,12 +2,8 @@
Feature: Kumade without jammit
Background:
- Given a directory named "executable"
- And I cd to "executable"
- And I set up the Gemfile with kumade
- And I bundle
- When I set up a git repo
- And I create a Heroku remote named "pretend-staging"
+ Given a directory set up for kumade
+ When I create a Heroku remote named "pretend-staging"
Scenario: Jammit packager does not run if Jammit is not installed
When I run kumade with "pretend-staging"
View
8 features/no_op_packager.feature
@@ -8,11 +8,11 @@ Feature: No-op packager
Given a new Rails application with Kumade
When I create a Heroku remote named "staging"
- Scenario: No-op packager runs in pretend mode if Jammit is not installed
+ Scenario: No-op packager does not run in pretend mode if Jammit is not installed
When I run kumade with "staging -p"
- Then the output should contain "==> Packaged with Kumade::NoopPackager"
+ Then the output should not contain "==> Packaged with Kumade::NoopPackager"
- Scenario: No-op packager runs in normal mode if Jammit is not installed
+ Scenario: No-op packager does not run in normal mode if Jammit is not installed
When I add the origin remote
And I run kumade
- Then the output should contain "==> Packaged with Kumade::NoopPackager"
+ Then the output should not contain "==> Packaged with Kumade::NoopPackager"
View
5 features/rake_task_before_asset_compilation.feature
@@ -12,13 +12,12 @@ Feature: Rake task that runs before asset compilation
Then the output should contain "kumade:before_asset_compilation"
And the output should contain "Hi!"
- Scenario: Custom task runs if Jammit is not installed
+ Scenario: Custom task runs does not run if Jammit is not installed
Given a new Rails application with Kumade
When I create a Heroku remote named "pretend-staging"
And I add a pre-compilation rake task that prints "Hi!"
And I run kumade with "pretend-staging"
- Then the output should contain "kumade:before_asset_compilation"
- And the output should contain "Hi!"
+ Then the output should not contain "kumade:before_asset_compilation"
Scenario: Pre-asset compilation task does not run when pretending
Given a new Rails application with Kumade and Jammit
View
4 features/step_definitions/git_steps.rb
@@ -29,3 +29,7 @@
When /^I add the origin remote$/ do
add_origin_remote
end
+
+When /^I switch to the "([^"]+)" branch$/ do |branch_name|
+ run_simple("git checkout -b #{branch_name}")
+end
View
8 lib/kumade/packager.rb
@@ -6,8 +6,10 @@ def initialize(git, packager = Packager.available_packager)
end
def run
- precompile_assets
- package
+ if @packager.installed?
+ precompile_assets
+ package
+ end
end
def self.available_packager
@@ -21,7 +23,7 @@ def precompile_assets
end
def package
- return Kumade.configuration.outputter.success(success_message) if Kumade.configuration.pretending? || @packager == NoopPackager
+ return Kumade.configuration.outputter.success(success_message) if Kumade.configuration.pretending?
begin
@packager.package
View
4 spec/kumade/packager_spec.rb
@@ -9,7 +9,7 @@
Kumade::Packager.available_packager.should == packager_1
end
- it "returns nil if no packagers are availabke" do
+ it "returns nil if no packagers are available" do
Kumade::PackagerList.stubs(:new => [])
Kumade::Packager.available_packager.should be_nil
end
@@ -17,7 +17,7 @@
describe Kumade::Packager, "#run", :with_mock_outputter do
let(:git) { stub("git", :dirty? => true, :add_and_commit_all_assets_in => true) }
- let(:packager) { stub("packager", :name => "MyPackager", :package => true, :assets_path => 'fake_assets_path') }
+ let(:packager) { stub("packager", :name => "MyPackager", :package => true, :assets_path => 'fake_assets_path', :installed? => true) }
let(:rake_task_runner) { stub("RakeTaskRunner", :invoke => true) }
before do
Please sign in to comment.
Something went wrong with that request. Please try again.