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:
commit
6a1ffd6550
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue