aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2023-06-10 00:24:54 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-06-15 07:01:25 +0900
commit3e7f5b02aeb2a55b27d402024f42821684d85ec6 (patch)
tree340cfafdfb417a7340a8f861478fcf7440da53bb /spec
parente86f4c581b274a3e0bb198b1567cc9aa07d95343 (diff)
downloadruby-3e7f5b02aeb2a55b27d402024f42821684d85ec6.tar.gz
[rubygems/rubygems] Improve error message in frozen mode edge case
When a top level dependency is missing from the lockfile, and we're in frozen mode, we should also print a "frozen error". https://github.com/rubygems/rubygems/commit/3e82b835e3
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/install/deploy_spec.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/bundler/install/deploy_spec.rb b/spec/bundler/install/deploy_spec.rb
index 5dcbf91e33..2a88ed5b06 100644
--- a/spec/bundler/install/deploy_spec.rb
+++ b/spec/bundler/install/deploy_spec.rb
@@ -312,6 +312,40 @@ RSpec.describe "install in deployment or frozen mode" do
expect(last_command).to be_success
end
+ it "shows a good error if a gem is missing from the lockfile" do
+ build_repo4 do
+ build_gem "foo"
+ build_gem "bar"
+ end
+
+ gemfile <<-G
+ source "https://gem.repo4"
+
+ gem "foo"
+ gem "bar"
+ G
+
+ lockfile <<~L
+ GEM
+ remote: https://gem.repo4/
+ specs:
+ foo (1.0)
+
+ PLATFORMS
+ #{lockfile_platforms}
+
+ DEPENDENCIES
+ foo
+ bar
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+
+ bundle :install, :env => { "BUNDLE_FROZEN" => "true" }, :raise_on_error => false, :artifice => "compact_index"
+ expect(err).to include("Your lock file is missing \"bar\", but the lockfile can't be updated because frozen mode is set")
+ end
+
it "explodes if a path gem is missing" do
build_lib "path_gem"
install_gemfile <<-G