forked from thoughtbot/kumade
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test Jammit packager against a real Rails app.
It now detects untracked asset files and commits them.
- Loading branch information
Gabe Berke-Williams
committed
Oct 22, 2011
1 parent
867594d
commit 810a832
Showing
8 changed files
with
52 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,20 @@ | ||
@creates-remote @disable-bundler | ||
@slow @creates-remote @disable-bundler | ||
Feature: Jammit | ||
As a user | ||
I want Kumade to auto-package with Jammit | ||
So that I don't have to remember to package assets | ||
|
||
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 configure my Rails app for Jammit | ||
And I create a Heroku remote named "staging" | ||
|
||
Scenario: Jammit packager runs if Jammit is installed | ||
When I run kumade with "pretend-staging" | ||
Then the output from "bundle exec kumade pretend-staging" should contain "==> ! Error: Jammit::MissingConfiguration" | ||
When I run kumade | ||
Then the output should contain "==> Packaged with Kumade::JammitPackager" | ||
|
||
Scenario: Run custom task before jammit | ||
Given I write to "Rakefile" with: | ||
""" | ||
namespace :kumade do | ||
task :before_asset_compilation do | ||
puts 'Hi!' | ||
end | ||
end | ||
""" | ||
When I run kumade with "pretend-staging -p" | ||
When I add a pre-compilation rake task that prints "Hi!" | ||
And I run kumade | ||
Then the output should contain "kumade:before_asset_compilation" | ||
And the output should contain "==> Packaged with Kumade::JammitPackager" | ||
And the output should contain "Hi!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
When /^I set up Jammit$/ do | ||
set_up_jammit | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module JammitHelpers | ||
def set_up_jammit | ||
assets_yaml = <<-YAML.strip | ||
javascripts: | ||
default: | ||
- public/javascripts/application.js | ||
YAML | ||
write_file('public/javascripts/application.js', 'var foo = 3;') | ||
write_file('config/assets.yml', assets_yaml) | ||
commit_everything_in_repo('add Jammit files') | ||
end | ||
end | ||
|
||
World(JammitHelpers) |