Permalink
Browse files

Ensure does not overwrite existing bourbon installation.

  • Loading branch information...
1 parent 89a1e19 commit 23141011ca68efc2aeb5ec8821422f05773f7bdc Gabe Berke-Williams and Phil LaPier committed with gabebw Jan 20, 2012
Showing with 26 additions and 4 deletions.
  1. +7 −1 features/generate.feature
  2. +7 −3 features/step_definitions/bourbon_steps.rb
  3. +12 −0 features/support/bourbon_support.rb
@@ -1,6 +1,6 @@
+@disable-bundler
Feature: Generate bourbon files via gem subcommand
- @disable-bundler
Scenario: Run `bourbon generate`
Given I set up bourbon
When I generate bourbon files
@@ -10,3 +10,9 @@ Feature: Generate bourbon files via gem subcommand
| bourbon/lib |
And the master bourbon partial should have been generated
And the lib files should have been generated
+ And the output should contain "Bourbon files generated to bourbon/"
+
+ Scenario: Generator does not overwrite an existing bourbon directory
+ Given bourbon is already generated
+ When I generate bourbon files
+ Then the output should contain "Bourbon files already generated, doing nothing."
@@ -1,10 +1,14 @@
+Given /^bourbon is already generated$/ do
+ set_up_bourbon_directory
+ generate_bourbon
+end
+
When /^I set up bourbon$/ do
- write_file("Gemfile", "gem 'bourbon', :path => '../../..'")
- run_simple("bundle install")
+ set_up_bourbon_directory
end
When /^I generate bourbon files$/ do
- run_simple("bundle exec bourbon generate")
+ generate_bourbon
end
Then /^the sass directories should have been generated$/ do
@@ -0,0 +1,12 @@
+module BourbonSupport
+ def set_up_bourbon_directory
+ write_file("Gemfile", "gem 'bourbon', :path => '../../..'")
+ run_simple("bundle install")
+ end
+
+ def generate_bourbon
+ run_simple("bundle exec bourbon generate")
+ end
+end
+
+World(BourbonSupport)

0 comments on commit 2314101

Please sign in to comment.