Skip to content

Commit

Permalink
Ensure does not overwrite existing bourbon installation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams and Phil LaPier authored and Gabe Berke-Williams committed Jan 20, 2012
1 parent 89a1e19 commit 2314101
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
8 changes: 7 additions & 1 deletion features/generate.feature
@@ -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
Expand All @@ -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."
10 changes: 7 additions & 3 deletions features/step_definitions/bourbon_steps.rb
@@ -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
Expand Down
12 changes: 12 additions & 0 deletions features/support/bourbon_support.rb
@@ -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.