fix for no extract results from uri check
This commit is contained in:
parent
2067f000f5
commit
527e101cab
|
@ -8,7 +8,8 @@ module Vagrant
|
|||
|
||||
def self.match?(uri)
|
||||
# URI.parse barfs on '<drive letter>:\\files \on\ windows'
|
||||
URI.extract(uri).first.include?(uri)
|
||||
uri = URI.extract(uri).first
|
||||
uri && uri.include?(uri)
|
||||
end
|
||||
|
||||
def download!(source_url, destination_file)
|
||||
|
|
|
@ -39,6 +39,11 @@ class HttpDownloaderTest < Test::Unit::TestCase
|
|||
URI.expects(:extract).returns(['foo'])
|
||||
assert Vagrant::Downloaders::HTTP.match?('foo')
|
||||
end
|
||||
|
||||
should "return false if there are no extract results" do
|
||||
URI.expects(:extract).returns([])
|
||||
assert !Vagrant::Downloaders::HTTP.match?('foo')
|
||||
end
|
||||
end
|
||||
|
||||
context "reporting progress" do
|
||||
|
|
Loading…
Reference in New Issue