core: helper to get the server URL

This commit is contained in:
Mitchell Hashimoto 2014-01-23 22:22:11 -08:00
parent 7b8002eba7
commit f9fe025d10
2 changed files with 16 additions and 0 deletions

View File

@ -8,6 +8,14 @@ module Vagrant
!ENV["VAGRANT_NO_PLUGINS"] !ENV["VAGRANT_NO_PLUGINS"]
end end
# Returns the URL prefix to the server.
#
# @return [String]
def self.server_url
# TODO: default
ENV["VAGRANT_SERVER_URL"]
end
# The source root is the path to the root directory of the Vagrant source. # The source root is the path to the root directory of the Vagrant source.
# #
# @return [Pathname] # @return [Pathname]

View File

@ -22,6 +22,14 @@ describe Vagrant do
end end
end end
describe "#server_url" do
it "is the VAGRANT_SERVER_URL value" do
with_temp_env("VAGRANT_SERVER_URL" => "foo") do
expect(subject.server_url).to eq("foo")
end
end
end
describe "#user_data_path" do describe "#user_data_path" do
around do |example| around do |example|
env = { env = {