@@ -694,6 +694,7 @@ def test_invoke_cli_calls_bundler_directly_for_install
694694 mock_install = mock ( "install" )
695695 mock_install . expects ( :run )
696696 Bundler ::CLI ::Install . expects ( :new ) . with ( { "no-cache" => true } ) . returns ( mock_install )
697+ Bundler ::Definition . any_instance . expects ( :check! ) . raises ( StandardError . new ( "missing gems" ) )
697698 RubyLsp ::SetupBundler . new ( dir , launcher : true ) . setup!
698699 end
699700 end
@@ -728,6 +729,8 @@ def test_invoke_cli_calls_bundler_directly_for_update
728729 { conservative : true } ,
729730 [ "ruby-lsp" , "debug" , "prism" ] ,
730731 ) . returns ( mock_update )
732+
733+ FileUtils . touch ( File . join ( dir , ".ruby-lsp" , "needs_update" ) )
731734 RubyLsp ::SetupBundler . new ( dir , launcher : true ) . setup!
732735 end
733736 end
@@ -749,6 +752,7 @@ def test_progress_is_printed_to_stderr
749752 system ( "bundle install" )
750753 end
751754
755+ Bundler ::Definition . any_instance . expects ( :check! ) . raises ( StandardError . new ( "missing gems" ) )
752756 stdout , stderr = capture_subprocess_io do
753757 RubyLsp ::SetupBundler . new ( dir , launcher : true ) . setup!
754758 end
@@ -844,41 +848,6 @@ def test_is_resilient_to_gemfile_changes_in_the_middle_of_setup
844848 end
845849 end
846850
847- def test_update_does_not_fail_if_gems_are_uninstalled
848- Dir . mktmpdir do |dir |
849- Dir . chdir ( dir ) do
850- File . write ( File . join ( dir , "Gemfile" ) , <<~GEMFILE )
851- source "https://rubygems.org"
852- gem "rdoc"
853- GEMFILE
854-
855- capture_subprocess_io do
856- Bundler . with_unbundled_env do
857- system ( "bundle install" )
858- run_script ( dir )
859-
860- mock_update = mock ( "update" )
861- mock_update . expects ( :run ) . raises ( Bundler ::GemNotFound . new ( "rdoc" ) )
862- require "bundler/cli/update"
863- Bundler ::CLI ::Update . expects ( :new ) . with (
864- { conservative : true } ,
865- [ "ruby-lsp" , "debug" , "prism" ] ,
866- ) . returns ( mock_update )
867-
868- mock_install = mock ( "install" )
869- mock_install . expects ( :run )
870- require "bundler/cli/install"
871- Bundler ::CLI ::Install . expects ( :new ) . with ( { "no-cache" => true } ) . returns ( mock_install )
872-
873- RubyLsp ::SetupBundler . new ( dir , launcher : true ) . setup!
874- end
875- end
876-
877- refute_path_exists ( File . join ( ".ruby-lsp" , "install_error" ) )
878- end
879- end
880- end
881-
882851 def test_only_returns_environment_if_bundle_was_composed_ahead_of_time
883852 Dir . mktmpdir do |dir |
884853 Dir . chdir ( dir ) do
0 commit comments