fixes an exception issue when a non-directory appears in the boxes dir
This commit is contained in:
parent
184f6dccb2
commit
bad38ca935
|
@ -133,7 +133,7 @@ module Vagrant
|
||||||
results = []
|
results = []
|
||||||
|
|
||||||
@logger.debug("Finding all boxes in: #{@directory}")
|
@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
|
box_name = child.basename.to_s
|
||||||
|
|
||||||
# If this is a V1 box, we still return that name, but specify
|
# 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 = instance.all.sort
|
||||||
results.should == [["bar", :virtualbox, :v1], ["foo", :vmware]]
|
results.should == [["bar", :virtualbox, :v1], ["foo", :vmware]]
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
describe "finding" do
|
describe "finding" do
|
||||||
|
|
Loading…
Reference in New Issue