Tests for GH-1478

This commit is contained in:
Mitchell Hashimoto 2013-03-22 14:56:02 -07:00
parent 47925e1c42
commit a9f269af24
1 changed files with 16 additions and 0 deletions

View File

@ -22,6 +22,8 @@ describe Vagrant::Environment do
let(:instance) { env.create_vagrant_env } let(:instance) { env.create_vagrant_env }
subject { instance }
describe "active machines" do describe "active machines" do
it "should be empty if the machines folder doesn't exist" do it "should be empty if the machines folder doesn't exist" do
folder = instance.local_data_path.join("machines") folder = instance.local_data_path.join("machines")
@ -110,6 +112,20 @@ describe Vagrant::Environment do
end end
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 describe "home path" do
it "is set to the home path given" do it "is set to the home path given" do
Dir.mktmpdir do |dir| Dir.mktmpdir do |dir|