diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-11-11 11:00:30 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2021-11-22 10:51:35 +0900 |
commit | e27381d289cbdbdca434bcc957c2cd1beab1c82c (patch) | |
tree | c50fe7f308ee10afc2e797b2f4760acc49ea64fc /spec/bundler/install/global_cache_spec.rb | |
parent | e262272b6a50c1a92cdcfee684e82f9242ef8171 (diff) |
Merge RubyGems 3.2.30 and Bundler 2.2.30
Diffstat (limited to 'spec/bundler/install/global_cache_spec.rb')
-rw-r--r-- | spec/bundler/install/global_cache_spec.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/bundler/install/global_cache_spec.rb b/spec/bundler/install/global_cache_spec.rb index 9bc243e7cf..afa0ff76c1 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" @@ -113,7 +125,7 @@ RSpec.describe "global gem caching" do expect(source2_global_cache("rack-0.9.1.gem")).to exist bundle :install, :artifice => "compact_index_no_gem", :raise_on_error => false expect(err).to include("Internal Server Error 500") - expect(err).not_to include("please copy and paste the report template above into a new issue") + expect(err).not_to include("ERROR REPORT TEMPLATE") # rack 1.0.0 is not installed and rack 0.9.1 is not expect(the_bundle).not_to include_gems "rack 1.0.0" @@ -128,7 +140,7 @@ RSpec.describe "global gem caching" do expect(source2_global_cache("rack-0.9.1.gem")).to exist bundle :install, :artifice => "compact_index_no_gem", :raise_on_error => false expect(err).to include("Internal Server Error 500") - expect(err).not_to include("please copy and paste the report template above into a new issue") + expect(err).not_to include("ERROR REPORT TEMPLATE") # rack 0.9.1 is not installed and rack 1.0.0 is not expect(the_bundle).not_to include_gems "rack 0.9.1" |