Skip to content

Commit

Permalink
Users can update their existing bourbon installation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Jan 20, 2012
1 parent 04c9e21 commit bf34e70
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@
bourbon/
demo/
tmp/
tags
2 changes: 1 addition & 1 deletion bin/bourbon
Expand Up @@ -2,4 +2,4 @@

require "bourbon"

Bourbon::Generator.new.generate
Bourbon::Generator.new(ARGV).run
3 changes: 1 addition & 2 deletions features/generate.feature
@@ -1,8 +1,7 @@
@disable-bundler
Feature: Generate bourbon files via gem subcommand
Feature: Generate bourbon files

Scenario: Run `bourbon generate`
Given I set up bourbon
When I generate bourbon files
Then the sass directories should have been generated
And the following directories should exist:
Expand Down
11 changes: 8 additions & 3 deletions features/step_definitions/bourbon_steps.rb
Expand Up @@ -3,12 +3,13 @@
generate_bourbon
end

When /^I set up bourbon$/ do
When /^I generate bourbon files$/ do
set_up_bourbon_directory
generate_bourbon
end

When /^I generate bourbon files$/ do
generate_bourbon
When /^I update bourbon files$/ do
update_bourbon
end

Then /^the sass directories should have been generated$/ do
Expand All @@ -24,3 +25,7 @@
check_file_presence(["bourbon/lib/sass_extensions.rb"], true)
check_directory_presence(["bourbon/lib/sass_extensions"], true)
end

Then /^bourbon should not have been generated$/ do
check_directory_presence(["bourbon"], false)
end
4 changes: 4 additions & 0 deletions features/support/bourbon_support.rb
Expand Up @@ -7,6 +7,10 @@ def set_up_bourbon_directory
def generate_bourbon
run_simple("bundle exec bourbon generate")
end

def update_bourbon
run_simple("bundle exec bourbon update")
end
end

World(BourbonSupport)
17 changes: 17 additions & 0 deletions features/update.feature
@@ -0,0 +1,17 @@
@disable-bundler
Feature: Update bourbon files

Scenario: `bourbon update` updates an existing bourbon install
When I generate bourbon files
And I write to "bourbon/_bourbon.scss" with:
"""
foobar
"""
And I update bourbon files
Then the output should contain "Bourbon files updated."
And the file "bourbon/_bourbon.scss" should not contain "foobar"

Scenario: `bourbon update` does not generate a new bourbon install
When I update bourbon files
Then bourbon should not have been generated
And the output should contain "No existing bourbon installation. Doing nothing."

0 comments on commit bf34e70

Please sign in to comment.