Skip to content
Browse files

Support bundler

  • Loading branch information...
1 parent 211003d commit f488c09ac864bc7d7932957e99573d32efa91fa4 @jferris jferris committed
Showing with 18 additions and 2 deletions.
  1. +1 −0 features/rails.feature
  2. +10 −1 features/step_definitions/rails_application_steps.rb
  3. +7 −1 features/support/terminal.rb
View
1 features/rails.feature
@@ -20,6 +20,7 @@ Feature: Install the Gem in a Rails application
And I run the hoptoad generator with "-k myapikey"
Then the command should have run successfully
When I uninstall the "hoptoad_notifier" gem
+ And I install cached gems
And I run "rake hoptoad:test"
Then the command should have run successfully
And I should receive two Hoptoad notifications
View
11 features/step_definitions/rails_application_steps.rb
@@ -129,7 +129,10 @@
end
When /^I unpack the "([^\"]*)" gem$/ do |gem_name|
- if rails_manages_gems?
+ if bundler_manages_gems?
+ @terminal.cd(RAILS_ROOT)
+ @terminal.run("bundle pack")
+ elsif rails_manages_gems?
@terminal.cd(RAILS_ROOT)
@terminal.run("rake gems:unpack GEM=#{gem_name}")
else
@@ -146,6 +149,12 @@
end
end
+When /^I install cached gems$/ do
+ if bundler_manages_gems?
+ When %{I run "bundle install"}
+ end
+end
+
When /^I install the "([^\"]*)" plugin$/ do |plugin_name|
FileUtils.mkdir_p("#{RAILS_ROOT}/vendor/plugins/#{plugin_name}")
end
View
8 features/support/terminal.rb
@@ -59,7 +59,13 @@ def install_gem_to(root, gem)
end
def environment_settings
- "GEM_HOME=#{LOCAL_GEM_ROOT} GEM_PATH=#{LOCAL_GEM_ROOT}:#{BUILT_GEM_ROOT}"
+ ["GEM_HOME=#{LOCAL_GEM_ROOT}",
+ "GEM_PATH=#{LOCAL_GEM_ROOT}:#{BUILT_GEM_ROOT}",
+ "PATH=#{gem_bin_path}:#{ENV['PATH']}"].join(' ')
+ end
+
+ def gem_bin_path
+ File.join(LOCAL_GEM_ROOT, "bin")
end
attr_reader :logger

0 comments on commit f488c09

Please sign in to comment.
Something went wrong with that request. Please try again.