Add coverage on vagrantfile_name stubbing behavior

This commit is contained in:
Chris Roberts 2018-07-18 10:50:41 -07:00
parent 1cd8a4b9be
commit 564dff651e
1 changed files with 13 additions and 1 deletions

View File

@ -121,7 +121,10 @@ describe "vagrant bin" do
context "plugin commands" do
let(:argv) { ["plugin"] }
before { allow(ENV).to receive(:[]=) }
before do
allow(ENV).to receive(:[]=)
allow(ENV).to receive(:[])
end
it "should unset vagrantfile" do
expect(Vagrant::Environment).to receive(:new).
@ -152,5 +155,14 @@ describe "vagrant bin" do
with(hash_excluding(vagrantfile_name: "")).and_return(env)
end
end
context "with VAGRANT_LOCAL_PLUGINS_LOAD enabled" do
before { expect(ENV).to receive(:[]).with("VAGRANT_LOCAL_PLUGINS_LOAD").and_return("1") }
it "should not unset vagrantfile" do
expect(Vagrant::Environment).to receive(:new).
with(hash_excluding(vagrantfile_name: "")).and_return(env)
end
end
end
end