Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1379 from radsaq/bundler

---

Dont hose existing load paths if Bundle.setup is called multiple times with a different set of groups.

This fixes #1230.
  • Loading branch information...
commit bc92a7ba6df3d720e4f1726b6c421e5378c36d25 2 parents 711b240 + 671141d
@indirect indirect authored
Showing with 20 additions and 2 deletions.
  1. +1 −2  lib/bundler.rb
  2. +19 −0 spec/runtime/setup_spec.rb
View
3  lib/bundler.rb
@@ -113,8 +113,7 @@ def setup(*groups)
unloaded = groups - @completed_groups
# Record groups that are now loaded
@completed_groups = groups
- # Load any groups that are not yet loaded
- unloaded.any? ? load.setup(*unloaded) : load
+ unloaded.any? ? load.setup(*groups) : load
end
end
View
19 spec/runtime/setup_spec.rb
@@ -25,6 +25,7 @@
before(:each) do
install_gemfile <<-G
source "file://#{gem_repo1}"
+ gem "yard"
gem "rack", :group => :test
G
end
@@ -58,6 +59,24 @@
err.should eq("")
out.should eq("1.0.0")
end
+
+ it "leaves :default available if setup is called twice" do
+ ruby <<-RUBY
+ require 'rubygems'
+ require 'bundler'
+ Bundler.setup(:default)
+ Bundler.setup(:default, :test)
+
+ begin
+ require 'yard'
+ puts "WIN"
+ rescue LoadError
+ puts "FAIL"
+ end
+ RUBY
+ err.should eq("")
+ out.should match("WIN")
+ end
end
it "raises if the Gemfile was not yet installed" do
Please sign in to comment.
Something went wrong with that request. Please try again.