forked from thoughtbot/bourbon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for
--path
option to install
- Loading branch information
Showing
4 changed files
with
49 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,32 @@ | ||
Given /^bourbon is already installed$/ do | ||
set_up_bourbon_directory | ||
install_bourbon | ||
end | ||
|
||
When /^I install bourbon files$/ do | ||
set_up_bourbon_directory | ||
install_bourbon | ||
end | ||
|
||
When /^I update bourbon files$/ do | ||
update_bourbon | ||
end | ||
|
||
Then /^the sass directories should have been generated$/ do | ||
sass_directories = ["bourbon/addons", "bourbon/css3", "bourbon/functions"] | ||
Then /^the sass directories(?: with "([^"]+)" prefix)? should have been generated$/ do |prefix| | ||
sass_directories = ["addons", "css3", "functions"] | ||
sass_directories.map!{ |directory| bourbon_path(prefix, directory) } | ||
check_directory_presence(sass_directories, true) | ||
end | ||
|
||
Then /^the master bourbon partial should have been generated$/ do | ||
check_file_presence(["bourbon/_bourbon.scss"], true) | ||
Then /^the master bourbon partial should have been generated(?: within "([^"]+)" directory)?$/ do |prefix| | ||
check_file_presence([bourbon_path(prefix, '_bourbon.scss')], true) | ||
end | ||
|
||
Then /^the lib files should have been generated$/ do | ||
check_file_presence(["bourbon/lib/bourbon.rb"], true) | ||
check_directory_presence(["bourbon/lib/bourbon"], true) | ||
check_file_presence(["bourbon/lib/bourbon/sass_extensions.rb"], true) | ||
check_directory_presence(["bourbon/lib/bourbon/sass_extensions"], true) | ||
Then /^the lib files should have been generated(?: within "([^"]+)" directory)?$/ do |prefix| | ||
check_file_presence([bourbon_path(prefix, 'lib/bourbon.rb')], true) | ||
check_directory_presence([bourbon_path(prefix, 'lib/bourbon')], true) | ||
check_file_presence([bourbon_path(prefix, 'lib/bourbon/sass_extensions.rb')], true) | ||
check_directory_presence([bourbon_path(prefix, 'lib/bourbon/sass_extensions')], true) | ||
end | ||
|
||
Then /^bourbon should not have been generated$/ do | ||
check_directory_presence(["bourbon"], false) | ||
check_directory_presence(['bourbon'], false) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
module BourbonSupport | ||
def set_up_bourbon_directory | ||
write_file("Gemfile", "gem 'bourbon', :path => '../../..'") | ||
run_simple("bundle install") | ||
end | ||
|
||
def install_bourbon | ||
run_simple("bundle exec bourbon install") | ||
end | ||
|
||
def update_bourbon | ||
run_simple("bundle exec bourbon update") | ||
end | ||
|
||
def bourbon_path(prefix, path) | ||
if prefix | ||
File.join(prefix, 'bourbon', path) | ||
else | ||
File.join('bourbon', path) | ||
end | ||
end | ||
end | ||
|
||
World(BourbonSupport) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters