summaryrefslogtreecommitdiff
path: root/spec/bundler/runtime/setup_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/runtime/setup_spec.rb')
-rw-r--r--spec/bundler/runtime/setup_spec.rb34
1 files changed, 32 insertions, 2 deletions
diff --git a/spec/bundler/runtime/setup_spec.rb b/spec/bundler/runtime/setup_spec.rb
index 0344d24223..7f4c0759d1 100644
--- a/spec/bundler/runtime/setup_spec.rb
+++ b/spec/bundler/runtime/setup_spec.rb
@@ -767,6 +767,18 @@ end
expect(err).to be_empty
end
+ it "can require rubygems without warnings, when using a local cache", :truffleruby do
+ install_gemfile <<-G
+ source "#{file_uri_for(gem_repo1)}"
+ gem "rack"
+ G
+
+ bundle "package"
+ bundle %(exec ruby -w -e "require 'rubygems'")
+
+ expect(err).to be_empty
+ end
+
context "when the user has `MANPATH` set", :man do
before { ENV["MANPATH"] = "/foo#{File::PATH_SEPARATOR}" }
@@ -930,9 +942,9 @@ end
G
run <<-R
- puts Bundler.rubygems.all_specs.map(&:name)
+ puts Bundler.rubygems.installed_specs.map(&:name)
Gem.refresh
- puts Bundler.rubygems.all_specs.map(&:name)
+ puts Bundler.rubygems.installed_specs.map(&:name)
R
expect(out).to eq("activesupport\nbundler\nactivesupport\nbundler")
@@ -1364,6 +1376,24 @@ end
expect(out).to eq("undefined\nconstant")
end
+ it "activates default gems when they are part of the bundle, but not installed explicitly", :ruby_repo do
+ default_json_version = ruby "gem 'json'; require 'json'; puts JSON::VERSION"
+
+ build_repo2 do
+ build_gem "json", default_json_version
+ end
+
+ gemfile "source \"#{file_uri_for(gem_repo2)}\"; gem 'json'"
+
+ ruby <<-RUBY
+ require "bundler/setup"
+ require "json"
+ puts defined?(::JSON) ? "JSON defined" : "JSON undefined"
+ RUBY
+
+ expect(err).to be_empty
+ end
+
describe "default gem activation" do
let(:exemptions) do
exempts = %w[did_you_mean bundler uri pathname]