Mock up public/private network calls for #call test

This commit is contained in:
Brian Cain 2019-03-21 13:03:39 -07:00
parent 8c169714c5
commit 32807d70c7
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
1 changed files with 10 additions and 0 deletions

View File

@ -96,6 +96,16 @@ describe VagrantPlugins::DockerProvider::Action::PrepareNetworks do
allow(subject).to receive(:request_public_gateway).and_return("1234") allow(subject).to receive(:request_public_gateway).and_return("1234")
allow(subject).to receive(:request_public_iprange).and_return("1234") allow(subject).to receive(:request_public_iprange).and_return("1234")
expect(subject).to receive(:process_private_network).with(networks[0][1], {}, env).
and_return(["vagrant_network_172.20.128.0/24", {:ipv6=>false, :subnet=>"172.20.128.0/24"}])
expect(subject).to receive(:process_public_network).with(networks[1][1], {}, env).
and_return(["vagrant_network_public_wlp4s0", {"opt"=>"parent=wlp4s0", "subnet"=>"192.168.1.0/24", "driver"=>"macvlan", "gateway"=>"1234", "ipv6"=>false, "ip_range"=>"1234"}])
expect(subject).to receive(:process_private_network).with(networks[2][1], {}, env).
and_return(["vagrant_network_2a02:6b8:b010:9020:1::/80", {:ipv6=>true, :subnet=>"2a02:6b8:b010:9020:1::/80"}])
allow(machine.ui).to receive(:ask).and_return("1") allow(machine.ui).to receive(:ask).and_return("1")
expect(driver).to receive(:create_network). expect(driver).to receive(:create_network).