core: Vagrant.server_url should default if empty
This commit is contained in:
parent
56ed5ef4cb
commit
b8676a65dd
|
@ -19,7 +19,9 @@ module Vagrant
|
|||
#
|
||||
# @return [String]
|
||||
def self.server_url
|
||||
ENV["VAGRANT_SERVER_URL"] || DEFAULT_SERVER_URL
|
||||
result = ENV["VAGRANT_SERVER_URL"]
|
||||
result = nil if result == ""
|
||||
result || DEFAULT_SERVER_URL
|
||||
end
|
||||
|
||||
# The source root is the path to the root directory of the Vagrant source.
|
||||
|
|
|
@ -30,6 +30,13 @@ describe Vagrant do
|
|||
end
|
||||
end
|
||||
|
||||
it "defaults if the string is empty" do
|
||||
with_temp_env("VAGRANT_SERVER_URL" => "") do
|
||||
expect(subject.server_url).to eq(
|
||||
Vagrant::DEFAULT_SERVER_URL)
|
||||
end
|
||||
end
|
||||
|
||||
it "is the VAGRANT_SERVER_URL value" do
|
||||
with_temp_env("VAGRANT_SERVER_URL" => "foo") do
|
||||
expect(subject.server_url).to eq("foo")
|
||||
|
|
Loading…
Reference in New Issue