Merge pull request #1155 from sl4m/patch-01

Fixes an exception issue when a non-directory appears in the boxes dir
This commit is contained in:
Mitchell Hashimoto 2012-09-27 11:49:58 -07:00
commit 6a1ffd6550
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