summaryrefslogtreecommitdiff
path: root/spec/bundler/install
diff options
context:
space:
mode:
authorDavid Rodriguez <deivid.rodriguez@riseup.net>2021-10-21 00:04:09 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-10-25 20:48:51 +0900
commitf7f85c1febd23eec04f78bc461b21ea604a865a9 (patch)
tree752daf8cc4ee316e928fd092f063484444743b5e /spec/bundler/install
parent4fc29d17b36e12311c1fe1d2f63e463bbf8ad725 (diff)
[rubygems/rubygems] Manage global gem cache directly
Previously, it was maintained in sync with the standard cache. That was less efficient, and it caused some error messages to point to non existent files. https://github.com/rubygems/rubygems/commit/931f8cb8a9
Diffstat (limited to 'spec/bundler/install')
-rw-r--r--spec/bundler/install/global_cache_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/bundler/install/global_cache_spec.rb b/spec/bundler/install/global_cache_spec.rb
index 9bc243e7cf..2a679fd424 100644
--- a/spec/bundler/install/global_cache_spec.rb
+++ b/spec/bundler/install/global_cache_spec.rb
@@ -37,6 +37,18 @@ RSpec.describe "global gem caching" do
expect(the_bundle).to include_gems "rack 1.0.0"
end
+ it "shows a proper error message if a cached gem is corrupted" do
+ source_global_cache.mkpath
+ FileUtils.touch(source_global_cache("rack-1.0.0.gem"))
+
+ install_gemfile <<-G, :artifice => "compact_index_no_gem", :raise_on_error => false
+ source "#{source}"
+ gem "rack"
+ G
+
+ expect(err).to include("Gem::Package::FormatError: package metadata is missing in #{source_global_cache("rack-1.0.0.gem")}")
+ end
+
describe "when the same gem from different sources is installed" do
it "should use the appropriate one from the global cache" do
install_gemfile <<-G, :artifice => "compact_index"