summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2009-07-28 19:59:38 -0700
committerCarl Lerche <carllerche@mac.com>2009-07-28 19:59:38 -0700
commit1a51467e0b9673e44ee4acb50edbeb9c4886e4ad (patch)
tree19cad33939f4ae2b0ad32cb81841606977103dcd
parent7119291be40909f801598f7cb55d72a48435c0a9 (diff)
downloadbundler-1a51467e0b9673e44ee4acb50edbeb9c4886e4ad.tar.gz
Correctly set Gem.loaded_specs when rubygems is automatically required
-rw-r--r--lib/bundler/templates/environment.rb1
-rw-r--r--spec/bundler/cli_spec.rb7
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/bundler/templates/environment.rb b/lib/bundler/templates/environment.rb
index a782481ab3..7d974bc539 100644
--- a/lib/bundler/templates/environment.rb
+++ b/lib/bundler/templates/environment.rb
@@ -21,6 +21,7 @@ $LOAD_PATH.unshift "<%= load_path %>"
<% end %>
<% if @rubygems == :require %>
require "rubygems"
+Bundler.rubygems_required
<% elsif @rubygems == :disable %>
$" << "rubygems.rb"
module Kernel
diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb
index 716320850f..3930672a35 100644
--- a/spec/bundler/cli_spec.rb
+++ b/spec/bundler/cli_spec.rb
@@ -170,8 +170,13 @@ end
end
end
+ it "already has gems in the loaded_specs" do
+ out = run_in_context "puts Gem.loaded_specs.key?('extlib')"
+ out.should == "true\n"
+ end
+
it "does already has rubygems required" do
- out = `#{tmp_file('bin', 'rake')} -e 'puts Gem.respond_to?(:sources)'`
+ out = run_in_context "puts Gem.respond_to?(:sources)"
out.should =~ /true/
end
end