summaryrefslogtreecommitdiff
path: root/spec/bundler/cache/gems_spec.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2023-12-11 13:19:45 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-12-13 13:02:22 +0900
commitac939d9ca3164a748c656ea7f33c356d7b91b0f9 (patch)
tree867684d65fa0b00cfe3cb117fad59ebe4aaa67a6 /spec/bundler/cache/gems_spec.rb
parent1a7aa5560f1a9967e320f71b7e8e8ee748151168 (diff)
[rubygems/rubygems] Improve default gem handling
If a gem is specified in the Gemfile (or resolved as a transitive dependency), it's always resolved from remote/installed sources. Default gems are only used as a fallback for gems not included in the bundle. I believe this leads to more consistent behavior and more portable apps, since all gems will be installed to the configured bundle path, regardless of whether they are default gems or not. https://github.com/rubygems/rubygems/commit/091b4fcf2b
Diffstat (limited to 'spec/bundler/cache/gems_spec.rb')
-rw-r--r--spec/bundler/cache/gems_spec.rb17
1 files changed, 2 insertions, 15 deletions
diff --git a/spec/bundler/cache/gems_spec.rb b/spec/bundler/cache/gems_spec.rb
index abbc2c3cf2..b4ca488562 100644
--- a/spec/bundler/cache/gems_spec.rb
+++ b/spec/bundler/cache/gems_spec.rb
@@ -102,8 +102,8 @@ RSpec.describe "bundle cache" do
it "uses builtin gems when installing to system gems" do
bundle "config set path.system true"
- install_gemfile %(source "#{file_uri_for(gem_repo1)}"; gem 'json', '#{default_json_version}'), verbose: true
- expect(out).to include("Using json #{default_json_version}")
+ install_gemfile %(source "#{file_uri_for(gem_repo2)}"; gem 'json', '#{default_json_version}'), verbose: true
+ expect(out).to include("Installing json #{default_json_version}")
end
it "caches remote and builtin gems" do
@@ -143,19 +143,6 @@ RSpec.describe "bundle cache" do
bundle "install --local"
expect(the_bundle).to include_gems("builtin_gem_2 1.0.2")
end
-
- it "errors if the builtin gem isn't available to cache" do
- bundle "config set path.system true"
-
- install_gemfile <<-G
- source "#{file_uri_for(gem_repo1)}"
- gem 'json', '#{default_json_version}'
- G
-
- bundle :cache, raise_on_error: false
- expect(exitstatus).to_not eq(0)
- expect(err).to include("json-#{default_json_version} is built in to Ruby, and can't be cached")
- end
end
describe "when there are also git sources" do