Permalink
Browse files

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

  • Loading branch information...
1 parent 05c85d7 commit 4486361bf87811fb9ecc6c567fb225ba58f3a25b @sikachu sikachu committed with Phil LaPier Oct 5, 2012
@@ -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|
@@ -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)
@@ -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."
@@ -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

0 comments on commit 4486361

Please sign in to comment.