summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2024-04-23 20:15:30 +0200
committergit <svn-admin@ruby-lang.org>2024-04-29 08:57:35 +0000
commitd6cb62a88f4d31548dfedd1cdb4082be8b7ced2e (patch)
treef9c056ee90ece94f00e059d7b12140d4ac9e9287 /spec
parent68a1867f53c5343a72a436fe75eccafdbcb41ce0 (diff)
[rubygems/rubygems] Show better error when installed gemspecs are unreadable
https://github.com/rubygems/rubygems/commit/924f87c8a9
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/commands/install_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb
index f0c9aaea8e..1e57414377 100644
--- a/spec/bundler/commands/install_spec.rb
+++ b/spec/bundler/commands/install_spec.rb
@@ -1024,6 +1024,29 @@ RSpec.describe "bundle install with gem sources" do
end
end
+ describe "when gemspecs are unreadable", :permissions do
+ let(:gemspec_path) { vendored_gems("specifications/rack-1.0.0.gemspec") }
+
+ before do
+ gemfile <<~G
+ source "#{file_uri_for(gem_repo1)}"
+ gem 'rack'
+ G
+ bundle "config path vendor/bundle"
+ bundle :install
+ expect(out).to include("Bundle complete!")
+ expect(err).to be_empty
+
+ FileUtils.chmod("-r", gemspec_path)
+ end
+
+ it "shows a good error" do
+ bundle :install, raise_on_error: false
+ expect(err).to include(gemspec_path.to_s)
+ expect(err).to include("grant read permissions")
+ end
+ end
+
context "after installing with --standalone" do
before do
install_gemfile <<-G