fixes an exception issue when a non-directory appears in the boxes dir

This commit is contained in:
skim 2012-09-25 21:13:38 -05:00
parent 184f6dccb2
commit bad38ca935
2 changed files with 6 additions and 1 deletions

View File

@ -133,7 +133,7 @@ module Vagrant
results = []
@logger.debug("Finding all boxes in: #{@directory}")
@directory.children(true).each do |child|
@directory.children(true).select(&:directory?).each do |child|
box_name = child.basename.to_s
# If this is a V1 box, we still return that name, but specify

View File

@ -135,6 +135,11 @@ describe Vagrant::BoxCollection do
results = instance.all.sort
results.should == [["bar", :virtualbox, :v1], ["foo", :vmware]]
end
it 'does not raise an exception when a file appears in the boxes dir' do
Tempfile.new('a_file', environment.boxes_dir)
expect { instance.all }.to_not raise_error
end
end
describe "finding" do