Add vagrantfile double for environment class

This commit is contained in:
Brian Cain 2019-09-11 09:01:35 -07:00
parent f14cf09af6
commit e820b5df8e
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
4 changed files with 12 additions and 8 deletions

View File

@ -33,8 +33,10 @@ describe VagrantPlugins::DockerProvider::Action::ConnectNetworks do
let(:docker_connects) { {0=>"vagrant_network_172.20.0.0/16", 1=>"vagrant_network_public_wlp4s0", 2=>"vagrant_network_2a02:6b8:b010:9020:1::/80"} }
let(:vagrantfile) { double("vagrantfile") }
let(:env) {{ machine: machine, ui: machine.ui, root_path: Pathname.new("."),
docker_connects: docker_connects }}
docker_connects: docker_connects, vagrantfile: vagrantfile }}
let(:app) { lambda { |*args| }}
let(:driver) { double("driver", create: "abcd1234") }

View File

@ -28,7 +28,9 @@ describe VagrantPlugins::DockerProvider::Action::DestroyNetwork do
end
end
let(:env) {{ machine: machine, ui: machine.ui, root_path: Pathname.new(".") }}
let(:vagrantfile) { double("vagrantfile") }
let(:env) {{ machine: machine, ui: machine.ui, root_path: Pathname.new("."), vagrantfile: vagrantfile }}
let(:app) { lambda { |*args| }}
let(:driver) { double("driver", create: "abcd1234") }

View File

@ -33,7 +33,9 @@ describe VagrantPlugins::DockerProvider::Action::Login do
end
end
let(:env) {{ machine: machine, ui: machine.ui, root_path: Pathname.new(".") }}
let(:vagrantfile) { double("vagrantfile") }
let(:env) {{ machine: machine, ui: machine.ui, root_path: Pathname.new("."), vagrantfile: vagrantfile }}
let(:app) { lambda { |*args| }}
let(:driver) { double("driver", create: "abcd1234") }

View File

@ -28,7 +28,9 @@ describe VagrantPlugins::DockerProvider::Action::PrepareNetworks do
end
end
let(:env) {{ machine: machine, ui: machine.ui, root_path: Pathname.new(".") }}
let(:vagrantfile) { double("vagrantfile") }
let(:env) {{ machine: machine, ui: machine.ui, root_path: Pathname.new("."), vagrantfile: vagrantfile }}
let(:app) { lambda { |*args| }}
let(:driver) { double("driver", create: "abcd1234") }
@ -64,10 +66,6 @@ describe VagrantPlugins::DockerProvider::Action::PrepareNetworks do
subject { described_class.new(app, env) }
before do
allow(driver).to receive(:execute) { |*args| @cmd = args.join(' ') }
end
after do
sandbox.close
end