diff --git a/bundler/spec/commands/clean_spec.rb b/bundler/spec/commands/clean_spec.rb index 48a5dba4aa9d..81209388ae97 100644 --- a/bundler/spec/commands/clean_spec.rb +++ b/bundler/spec/commands/clean_spec.rb @@ -913,12 +913,10 @@ def should_not_have_gems(*gems) # Simulate that the locked bundler version is installed in the bundle path # by creating the gem directory and gemspec (as would happen after bundle install with that version) Pathname(vendored_gems("cache/bundler-#{version}.gem")).tap do |path| - path.basename.mkpath FileUtils.touch(path) end FileUtils.touch(vendored_gems("gems/bundler-#{version}")) Pathname(vendored_gems("specifications/bundler-#{version}.gemspec")).tap do |path| - path.basename.mkpath path.write(<<~GEMSPEC) Gem::Specification.new do |s| s.name = "bundler" @@ -934,11 +932,5 @@ def should_not_have_gems(*gems) bundle :clean should_have_gems "bundler-#{version}" - ensure - ["bundler-#{version}.gem", "bundler-#{version}.gemspec"].each do |filename| - Pathname(vendored_gems(filename)).tap do |path| - FileUtils.rm_rf(path.basename) - end - end end end