diff --git a/lib/vagrant/shared_helpers.rb b/lib/vagrant/shared_helpers.rb index f1385987d..00c4a4bac 100644 --- a/lib/vagrant/shared_helpers.rb +++ b/lib/vagrant/shared_helpers.rb @@ -8,6 +8,14 @@ module Vagrant !ENV["VAGRANT_NO_PLUGINS"] 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. # # @return [Pathname] diff --git a/test/unit/vagrant/shared_helpers_test.rb b/test/unit/vagrant/shared_helpers_test.rb index c11408802..b3561c9a9 100644 --- a/test/unit/vagrant/shared_helpers_test.rb +++ b/test/unit/vagrant/shared_helpers_test.rb @@ -22,6 +22,14 @@ describe Vagrant do 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 around do |example| env = {