Try to mock up docker version subprocess result in test
This commit is contained in:
parent
d4002aa74d
commit
c7b1f8821d
|
@ -66,6 +66,18 @@ describe VagrantPlugins::DockerProvider::Action::ConnectNetworks do
|
|||
|
||||
subject { described_class.new(app, env) }
|
||||
|
||||
let(:subprocess_result) do
|
||||
double("subprocess_result").tap do |result|
|
||||
allow(result).to receive(:exit_code).and_return(0)
|
||||
allow(result).to receive(:stdout).and_return("")
|
||||
allow(result).to receive(:stderr).and_return("")
|
||||
end
|
||||
end
|
||||
|
||||
before do
|
||||
allow(Vagrant::Util::Subprocess).to receive(:execute).with("docker", "version", an_instance_of(Hash)).and_return(subprocess_result)
|
||||
end
|
||||
|
||||
after do
|
||||
sandbox.close
|
||||
end
|
||||
|
|
|
@ -55,6 +55,18 @@ describe VagrantPlugins::DockerProvider::Action::DestroyNetwork do
|
|||
|
||||
subject { described_class.new(app, env) }
|
||||
|
||||
let(:subprocess_result) do
|
||||
double("subprocess_result").tap do |result|
|
||||
allow(result).to receive(:exit_code).and_return(0)
|
||||
allow(result).to receive(:stdout).and_return("")
|
||||
allow(result).to receive(:stderr).and_return("")
|
||||
end
|
||||
end
|
||||
|
||||
before do
|
||||
allow(Vagrant::Util::Subprocess).to receive(:execute).with("docker", "version", an_instance_of(Hash)).and_return(subprocess_result)
|
||||
end
|
||||
|
||||
after do
|
||||
sandbox.close
|
||||
end
|
||||
|
|
|
@ -43,6 +43,18 @@ describe VagrantPlugins::DockerProvider::Action::Login do
|
|||
|
||||
subject { described_class.new(app, env) }
|
||||
|
||||
let(:subprocess_result) do
|
||||
double("subprocess_result").tap do |result|
|
||||
allow(result).to receive(:exit_code).and_return(0)
|
||||
allow(result).to receive(:stdout).and_return("")
|
||||
allow(result).to receive(:stderr).and_return("")
|
||||
end
|
||||
end
|
||||
|
||||
before do
|
||||
allow(Vagrant::Util::Subprocess).to receive(:execute).with("docker", "version", an_instance_of(Hash)).and_return(subprocess_result)
|
||||
end
|
||||
|
||||
after do
|
||||
sandbox.close
|
||||
end
|
||||
|
|
|
@ -67,6 +67,18 @@ describe VagrantPlugins::DockerProvider::Action::PrepareNetworks do
|
|||
|
||||
subject { described_class.new(app, env) }
|
||||
|
||||
let(:subprocess_result) do
|
||||
double("subprocess_result").tap do |result|
|
||||
allow(result).to receive(:exit_code).and_return(0)
|
||||
allow(result).to receive(:stdout).and_return("")
|
||||
allow(result).to receive(:stderr).and_return("")
|
||||
end
|
||||
end
|
||||
|
||||
before do
|
||||
allow(Vagrant::Util::Subprocess).to receive(:execute).with("docker", "version", an_instance_of(Hash)).and_return(subprocess_result)
|
||||
end
|
||||
|
||||
after do
|
||||
sandbox.close
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue