Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow `bourbon update` to take `--path` argument

  • Loading branch information...
commit 4486361bf87811fb9ecc6c567fb225ba58f3a25b 1 parent 05c85d7
@sikachu sikachu authored plapier committed
View
7 features/step_definitions/bourbon_steps.rb
@@ -2,12 +2,7 @@
install_bourbon
end
-When /^I install bourbon files$/ do
- install_bourbon
-end
-
-When /^I update bourbon files$/ do
- update_bourbon
+Given /^I install bourbon to "([^"]*)"$/ do |path|
end
Then /^the sass directories(?: with "([^"]+)" prefix)? should have been generated$/ do |prefix|
View
12 features/support/bourbon_support.rb
@@ -1,10 +1,10 @@
module BourbonSupport
- def install_bourbon
- run_simple("bundle exec bourbon install")
- end
-
- def update_bourbon
- run_simple("bundle exec bourbon update")
+ def install_bourbon(path = nil)
+ if path
+ run_simple("bundle exec bourbon install --path '#{path}'")
+ else
+ run_simple("bundle exec bourbon install")
+ end
end
def bourbon_path(prefix, path)
View
21 features/update.feature
@@ -2,16 +2,29 @@
Feature: Update bourbon files
Scenario: Updating updates an existing bourbon install
- When I install bourbon files
- And I write to "bourbon/_bourbon.scss" with:
+ Given bourbon is already installed
+ When I write to "bourbon/_bourbon.scss" with:
"""
foobar
"""
- And I update bourbon files
+ And I run `bundle exec bourbon update`
Then the output should contain "Bourbon files updated."
And the file "bourbon/_bourbon.scss" should not contain "foobar"
+ Scenario: Updating with a --path option
+ Given I install bourbon to "custom_path"
+ When I write to "custom_path/bourbon/_bourbon.scss" with:
+ """
+ foobar
+ """
+ And I run `bundle exec bourbon update`
+ Then the output should contain "No existing bourbon installation. Doing nothing."
+
+ When I run `bundle exec bourbon update --path custom_path`
+ Then the output should contain "Bourbon files updated."
+ And the file "custom_path/bourbon/_bourbon.scss" should not contain "foobar"
+
Scenario: Updating does not generate a new bourbon install
- When I update bourbon files
+ And I run `bundle exec bourbon update`
Then bourbon should not have been generated
And the output should contain "No existing bourbon installation. Doing nothing."
View
1  lib/bourbon/generator.rb
@@ -17,6 +17,7 @@ def install
end
desc 'update', 'Update Bourbon'
+ method_options :path => :string
def update
if bourbon_files_already_exist?
remove_bourbon_directory
Please sign in to comment.
Something went wrong with that request. Please try again.