File tree Expand file tree Collapse file tree 2 files changed +44
-4
lines changed Expand file tree Collapse file tree 2 files changed +44
-4
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,15 @@ def initialize(options, gems)
26
26
def run
27
27
check_for_deployment_mode!
28
28
29
- gems . each do |gem_name |
30
- Bundler ::CLI ::Common . select_spec ( gem_name )
31
- end
32
-
33
29
Bundler . definition . validate_runtime!
34
30
current_specs = Bundler . ui . silence { Bundler . definition . resolve }
35
31
32
+ gems . each do |gem_name |
33
+ if current_specs [ gem_name ] . empty?
34
+ raise GemNotFound , "Could not find gem '#{ gem_name } '."
35
+ end
36
+ end
37
+
36
38
current_dependencies = Bundler . ui . silence do
37
39
Bundler . load . dependencies . map { |dep | [ dep . name , dep ] } . to_h
38
40
end
Original file line number Diff line number Diff line change @@ -526,6 +526,44 @@ def test_group_option(group)
526
526
527
527
expect ( out ) . to match ( Regexp . new ( expected_output ) )
528
528
end
529
+
530
+ it "does not require gems to be installed" do
531
+ build_repo4 do
532
+ build_gem "zeitwerk" , "1.0.0"
533
+ build_gem "zeitwerk" , "2.0.0"
534
+ end
535
+
536
+ gemfile <<-G
537
+ source "https://gem.repo4"
538
+ gem "zeitwerk"
539
+ G
540
+
541
+ lockfile <<~L
542
+ GEM
543
+ remote: https://gem.repo4/
544
+ specs:
545
+ zeitwerk (1.0.0)
546
+
547
+ PLATFORMS
548
+ #{ lockfile_platforms }
549
+
550
+ DEPENDENCIES
551
+ zeitwerk
552
+
553
+ BUNDLED WITH
554
+ #{ Bundler ::VERSION }
555
+ L
556
+
557
+ bundle "outdated zeitwerk" , raise_on_error : false
558
+
559
+ expected_output = <<~TABLE . tr ( "." , "\. " ) . strip
560
+ Gem Current Latest Requested Groups
561
+ zeitwerk 1.0.0 2.0.0 >= 0 default
562
+ TABLE
563
+
564
+ expect ( out ) . to match ( Regexp . new ( expected_output ) )
565
+ expect ( err ) . to be_empty
566
+ end
529
567
end
530
568
531
569
describe "pre-release gems" do
You can’t perform that action at this time.
0 commit comments