File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -898,4 +898,41 @@ def should_not_have_gems(*gems)
898898
899899 expect ( very_simple_binary_extensions_dir ) . to be_nil
900900 end
901+
902+ it "does not remove the bundler version currently running" do
903+ gemfile <<-G
904+ source "https://gem.repo1"
905+
906+ gem "myrack"
907+ G
908+
909+ bundle "config set path vendor/bundle"
910+ bundle "install"
911+
912+ version = Bundler . gem_version . to_s
913+ # Simulate that the locked bundler version is installed in the bundle path
914+ # by creating the gem directory and gemspec (as would happen after bundle install with that version)
915+ Pathname ( vendored_gems ( "cache/bundler-#{ version } .gem" ) ) . tap do |path |
916+ path . basename . mkpath
917+ FileUtils . touch ( path )
918+ end
919+ FileUtils . touch ( vendored_gems ( "gems/bundler-#{ version } " ) )
920+ Pathname ( vendored_gems ( "specifications/bundler-#{ version } .gemspec" ) ) . tap do |path |
921+ path . basename . mkpath
922+ path . write ( <<~GEMSPEC )
923+ Gem::Specification.new do |s|
924+ s.name = "bundler"
925+ s.version = "#{ version } "
926+ s.authors = ["bundler team"]
927+ s.summary = "The best way to manage your application's dependencies"
928+ end
929+ GEMSPEC
930+ end
931+
932+ should_have_gems "bundler-#{ version } "
933+
934+ bundle :clean
935+
936+ should_have_gems "bundler-#{ version } "
937+ end
901938end
You can’t perform that action at this time.
0 commit comments