From 2018fd864593915f52e2a2b353cc989dd6ec88d6 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 24 Dec 2010 18:35:46 -0800 Subject: [PATCH] "vbox-prev" bug still exists, but filename changes for VB4 --- lib/vagrant/action/vm/clean_machine_folder.rb | 2 +- test/vagrant/action/vm/clean_machine_folder_test.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/vagrant/action/vm/clean_machine_folder.rb b/lib/vagrant/action/vm/clean_machine_folder.rb index 86975bc12..5df3cf6fe 100644 --- a/lib/vagrant/action/vm/clean_machine_folder.rb +++ b/lib/vagrant/action/vm/clean_machine_folder.rb @@ -31,7 +31,7 @@ module Vagrant keep = Dir["#{f}/**/*"].find do |d| # Find a file that doesn't have ".xml-prev" as the suffix, # which signals that we want to keep this folder - File.file?(d) && !(File.basename(d) =~ /\.xml-prev$/) + File.file?(d) && !(File.basename(d) =~ /\.vbox-prev$/) end FileUtils.rm_rf(f) if !keep diff --git a/test/vagrant/action/vm/clean_machine_folder_test.rb b/test/vagrant/action/vm/clean_machine_folder_test.rb index 809714faa..ba1a0bb59 100644 --- a/test/vagrant/action/vm/clean_machine_folder_test.rb +++ b/test/vagrant/action/vm/clean_machine_folder_test.rb @@ -37,10 +37,10 @@ class CleanMachineFolderVMActionTest < Test::Unit::TestCase @instance.clean_machine_folder end - should "delete directories with only .xml-prev files" do + should "delete directories with only .vbox-prev files" do folders = { - "sfoo" => %W[foo bar baz.xml-prev], - "sbar" => %W[foo.xml-prev] + "sfoo" => %W[foo bar baz.vbox-prev], + "sbar" => %W[foo.vbox-prev] } Dir.expects(:[]).with(@folder).returns(folders.keys) @@ -57,7 +57,7 @@ class CleanMachineFolderVMActionTest < Test::Unit::TestCase should "delete directories with only subdirectories" do folders = { "sfoo" => %W[foo bar], - "sbar" => %W[foo.xml-prev] + "sbar" => %W[foo.vbox-prev] } File.stubs(:file?).returns(false)