"vbox-prev" bug still exists, but filename changes for VB4
This commit is contained in:
parent
e4488c415e
commit
2018fd8645
|
@ -31,7 +31,7 @@ module Vagrant
|
||||||
keep = Dir["#{f}/**/*"].find do |d|
|
keep = Dir["#{f}/**/*"].find do |d|
|
||||||
# Find a file that doesn't have ".xml-prev" as the suffix,
|
# Find a file that doesn't have ".xml-prev" as the suffix,
|
||||||
# which signals that we want to keep this folder
|
# 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
|
end
|
||||||
|
|
||||||
FileUtils.rm_rf(f) if !keep
|
FileUtils.rm_rf(f) if !keep
|
||||||
|
|
|
@ -37,10 +37,10 @@ class CleanMachineFolderVMActionTest < Test::Unit::TestCase
|
||||||
@instance.clean_machine_folder
|
@instance.clean_machine_folder
|
||||||
end
|
end
|
||||||
|
|
||||||
should "delete directories with only .xml-prev files" do
|
should "delete directories with only .vbox-prev files" do
|
||||||
folders = {
|
folders = {
|
||||||
"sfoo" => %W[foo bar baz.xml-prev],
|
"sfoo" => %W[foo bar baz.vbox-prev],
|
||||||
"sbar" => %W[foo.xml-prev]
|
"sbar" => %W[foo.vbox-prev]
|
||||||
}
|
}
|
||||||
|
|
||||||
Dir.expects(:[]).with(@folder).returns(folders.keys)
|
Dir.expects(:[]).with(@folder).returns(folders.keys)
|
||||||
|
@ -57,7 +57,7 @@ class CleanMachineFolderVMActionTest < Test::Unit::TestCase
|
||||||
should "delete directories with only subdirectories" do
|
should "delete directories with only subdirectories" do
|
||||||
folders = {
|
folders = {
|
||||||
"sfoo" => %W[foo bar],
|
"sfoo" => %W[foo bar],
|
||||||
"sbar" => %W[foo.xml-prev]
|
"sbar" => %W[foo.vbox-prev]
|
||||||
}
|
}
|
||||||
|
|
||||||
File.stubs(:file?).returns(false)
|
File.stubs(:file?).returns(false)
|
||||||
|
|
Loading…
Reference in New Issue