From a9f269af2414f2bf9986188d6af717a29c8f6ce0 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 22 Mar 2013 14:56:02 -0700 Subject: [PATCH] Tests for GH-1478 --- test/unit/vagrant/environment_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/unit/vagrant/environment_test.rb b/test/unit/vagrant/environment_test.rb index 82cc3e630..aff33d4ef 100644 --- a/test/unit/vagrant/environment_test.rb +++ b/test/unit/vagrant/environment_test.rb @@ -22,6 +22,8 @@ describe Vagrant::Environment do let(:instance) { env.create_vagrant_env } + subject { instance } + describe "active machines" do it "should be empty if the machines folder doesn't exist" do folder = instance.local_data_path.join("machines") @@ -110,6 +112,20 @@ describe Vagrant::Environment do end end + describe "default provider" do + it "is virtualbox without any environmental variable" do + with_temp_env("VAGRANT_DEFAULT_PROVIDER" => nil) do + subject.default_provider.should == :virtualbox + end + end + + it "is whatever the environmental variable is if set" do + with_temp_env("VAGRANT_DEFAULT_PROVIDER" => "foo") do + subject.default_provider.should == :foo + end + end + end + describe "home path" do it "is set to the home path given" do Dir.mktmpdir do |dir|