summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-09-13 13:38:55 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-09-15 15:32:04 +0200
commit8e8af52e136ac2c4ff7227e0bff0836f5112a038 (patch)
treea4c4c3dfc4ea865ed21d86e9701d08f7fb13b523 /spec
parent4398657a33113d2b8add71f38e128b323a81c733 (diff)
downloadbundler-8e8af52e136ac2c4ff7227e0bff0836f5112a038.tar.gz
Extract helper method
Diffstat (limited to 'spec')
-rw-r--r--spec/support/rubygems_ext.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/support/rubygems_ext.rb b/spec/support/rubygems_ext.rb
index 4c2386244c..83b1a90d90 100644
--- a/spec/support/rubygems_ext.rb
+++ b/spec/support/rubygems_ext.rb
@@ -40,10 +40,7 @@ module Spec
end
def gem_load(gem_name, bin_container)
- gem_activate(gem_name)
- load Gem.bin_path(gem_name, bin_container)
- rescue Gem::LoadError => e
- warn "We couln't activate #{gem_name} (#{e.requirement}). Run `gem install #{gem_name}:'#{e.requirement}'`"
+ gem_load_and_activate(gem_name, bin_container)
end
def gem_require(gem_name)
@@ -78,6 +75,13 @@ module Spec
private
+ def gem_load_and_activate(gem_name, bin_container)
+ gem_activate(gem_name)
+ load Gem.bin_path(gem_name, bin_container)
+ rescue Gem::LoadError => e
+ warn "We couln't activate #{gem_name} (#{e.requirement}). Run `gem install #{gem_name}:'#{e.requirement}'`"
+ end
+
def gem_activate(gem_name)
gem_requirement = DEV_DEPS[gem_name]
gem gem_name, gem_requirement