Bundler.setup(:group) clears previously bundled load paths with no way to re-load them #932

Closed
wants to merge 1 commit into
from
View
@@ -99,12 +99,10 @@ def setup(*groups)
# Load all groups, but only once
@setup = load.setup
else
- # Figure out which groups haven't been loaded yet
- unloaded = groups - (@completed_groups || [])
- # Record groups that are now loaded
+ # Record groups that should now be loaded
@completed_groups = groups | (@completed_groups || [])
- # Load any groups that are not yet loaded
- unloaded.any? ? load.setup(*unloaded) : load
+ # Load all groups that should be loaded
+ load.setup(*@completed_groups)
end
end
@@ -43,6 +43,17 @@
out = run("require 'thin'; puts THIN")
out.should == '1.0'
end
+
+ it "sets up multiple groups paths if Bundler.setup call is repeated" do
+ out = run(<<-R, :emo).split
+ require 'thin'; puts THIN
+ Bundler.setup(:default)
+ require 'rack'; puts RACK
+ Bundler.setup(:emo)
+ require 'activesupport'; puts ACTIVESUPPORT
+ R
+ out.should == ['1.0', '1.0.0', '2.3.5']
+ end
end
describe "installing --without" do