Fix docker test to not call docker executable
This commit is contained in:
parent
f3e960141e
commit
2f2d1f9cb2
|
@ -21,8 +21,6 @@ describe VagrantPlugins::DockerProvider::Provider do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe ".usable?" do
|
describe ".usable?" do
|
||||||
subject { described_class.new(machine) }
|
|
||||||
|
|
||||||
it "returns true if usable" do
|
it "returns true if usable" do
|
||||||
allow(provider_config).to receive(:compose).and_return(false)
|
allow(provider_config).to receive(:compose).and_return(false)
|
||||||
allow(subject.driver).to receive(:execute).with("docker", "version").and_return(true)
|
allow(subject.driver).to receive(:execute).with("docker", "version").and_return(true)
|
||||||
|
@ -53,9 +51,10 @@ describe VagrantPlugins::DockerProvider::Provider do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#state" do
|
describe "#state" do
|
||||||
|
before { allow(subject).to receive(:driver).and_return(driver_obj) }
|
||||||
|
|
||||||
it "returns not_created if no ID" do
|
it "returns not_created if no ID" do
|
||||||
allow(machine).to receive(:id).and_return(nil)
|
allow(machine).to receive(:id).and_return(nil)
|
||||||
|
|
||||||
expect(subject.state.id).to eq(:not_created)
|
expect(subject.state.id).to eq(:not_created)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -63,7 +62,8 @@ describe VagrantPlugins::DockerProvider::Provider do
|
||||||
allow(provider_config).to receive(:compose).and_return(false)
|
allow(provider_config).to receive(:compose).and_return(false)
|
||||||
allow(platform).to receive(:windows?).and_return(false)
|
allow(platform).to receive(:windows?).and_return(false)
|
||||||
allow(platform).to receive(:darwin?).and_return(false)
|
allow(platform).to receive(:darwin?).and_return(false)
|
||||||
allow(machine).to receive(:id).and_return("foo")
|
expect(machine).to receive(:id).and_return("foo")
|
||||||
|
expect(driver_obj).to receive(:created?).with("foo").and_return(false)
|
||||||
|
|
||||||
expect(subject.state.id).to eq(:not_created)
|
expect(subject.state.id).to eq(:not_created)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue