rmi docker provider tests: May also be in use by a stopped container

This commit is contained in:
Terry Burton 2020-03-23 23:28:18 +00:00
parent d372ba0b5d
commit b566b0ee13
No known key found for this signature in database
GPG Key ID: 11E9CA74601C8B2A

View File

@ -389,7 +389,7 @@ describe VagrantPlugins::DockerProvider::Driver do
end
end
context 'image is being used' do
context 'image is being used by running container' do
before { allow(subject).to receive(:execute).and_raise("image is being used by running container") }
it 'does not remove the image' do
@ -398,6 +398,15 @@ describe VagrantPlugins::DockerProvider::Driver do
end
end
context 'image is being used by stopped container' do
before { allow(subject).to receive(:execute).and_raise("image is being used by stopped container") }
it 'does not remove the image' do
expect(subject.rmi(id)).to eq(false)
subject.rmi(id)
end
end
context 'container is using it' do
before { allow(subject).to receive(:execute).and_raise("container is using it") }