Add machine config to machine double for rspec tests
This commit mocks up the docker machines test config so that it doesn't actually invoke the docker driver in circle-ci
This commit is contained in:
parent
ebe1f3f1c9
commit
21db2db9ac
|
@ -13,8 +13,17 @@ describe VagrantPlugins::DockerProvider::Action::ConnectNetworks do
|
|||
sandbox.create_vagrant_env
|
||||
end
|
||||
|
||||
let(:vm_config) { double("machine_vm_config") }
|
||||
|
||||
let(:machine_config) do
|
||||
double("machine_config").tap do |top_config|
|
||||
allow(top_config).to receive(:vm).and_return(vm_config)
|
||||
end
|
||||
end
|
||||
|
||||
let(:machine) do
|
||||
iso_env.machine(iso_env.machine_names[0], :docker).tap do |m|
|
||||
allow(m).to receive(:config).and_return(machine_config)
|
||||
allow(m).to receive(:id).and_return("12345")
|
||||
allow(m.provider).to receive(:driver).and_return(driver)
|
||||
allow(m.provider).to receive(:host_vm?).and_return(false)
|
||||
|
|
|
@ -12,8 +12,17 @@ describe VagrantPlugins::DockerProvider::Action::DestroyNetwork do
|
|||
sandbox.create_vagrant_env
|
||||
end
|
||||
|
||||
let(:vm_config) { double("machine_vm_config") }
|
||||
|
||||
let(:machine_config) do
|
||||
double("machine_config").tap do |top_config|
|
||||
allow(top_config).to receive(:vm).and_return(vm_config)
|
||||
end
|
||||
end
|
||||
|
||||
let(:machine) do
|
||||
iso_env.machine(iso_env.machine_names[0], :docker).tap do |m|
|
||||
allow(m).to receive(:config).and_return(machine_config)
|
||||
allow(m.provider).to receive(:driver).and_return(driver)
|
||||
allow(m.config.vm).to receive(:networks).and_return(networks)
|
||||
end
|
||||
|
|
|
@ -15,9 +15,18 @@ describe VagrantPlugins::DockerProvider::Action::Login do
|
|||
|
||||
let(:provider_config) { double("provider_config", username: "docker", password: "") }
|
||||
|
||||
let(:vm_config) { double("machine_vm_config") }
|
||||
|
||||
let(:machine_config) do
|
||||
double("machine_config").tap do |top_config|
|
||||
allow(top_config).to receive(:vm).and_return(vm_config)
|
||||
end
|
||||
end
|
||||
|
||||
let(:machine) do
|
||||
iso_env.machine(iso_env.machine_names[0], :docker).tap do |m|
|
||||
allow(m).to receive(:id).and_return("12345")
|
||||
allow(m).to receive(:config).and_return(machine_config)
|
||||
allow(m).to receive(:provider_config).and_return(provider_config)
|
||||
allow(m.provider).to receive(:driver).and_return(driver)
|
||||
allow(m.provider).to receive(:host_vm?).and_return(false)
|
||||
|
|
|
@ -12,8 +12,17 @@ describe VagrantPlugins::DockerProvider::Action::PrepareNetworks do
|
|||
sandbox.create_vagrant_env
|
||||
end
|
||||
|
||||
let(:vm_config) { double("machine_vm_config") }
|
||||
|
||||
let(:machine_config) do
|
||||
double("machine_config").tap do |top_config|
|
||||
allow(top_config).to receive(:vm).and_return(vm_config)
|
||||
end
|
||||
end
|
||||
|
||||
let(:machine) do
|
||||
iso_env.machine(iso_env.machine_names[0], :docker).tap do |m|
|
||||
allow(m).to receive(:config).and_return(machine_config)
|
||||
allow(m.provider).to receive(:driver).and_return(driver)
|
||||
allow(m.config.vm).to receive(:networks).and_return(networks)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue