"vbox-prev" bug still exists, but filename changes for VB4

This commit is contained in:
Mitchell Hashimoto 2010-12-24 18:35:46 -08:00
parent e4488c415e
commit 2018fd8645
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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)