1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/fogdocker/requests/compute/image_delete_tests.rb
2014-02-16 01:06:49 +02:00

20 lines
746 B
Ruby

Shindo.tests("Fog::Compute[:fogdocker] | image_delete request", 'fogdocker') do
compute = Fog::Compute[:fogdocker]
image_hash = compute.image_create({'fromImage' => 'mattdm/fedora', 'repo'=>'test', 'tag'=>'delete_image'})
tests("Delete image") do
begin
response = compute.image_delete(:id => image_hash['id'])
test("should be success") { response ? true : false } #mock doesn't throw errors
rescue => e
#should raise image not found
test("error should be a kind of Docker::Error::NotFoundError") { e.kind_of? Docker::Error::NotFoundError}
end
end
tests('The expected options') do
raises(ArgumentError, 'raises ArgumentError when id option is missing') { compute.container_delete }
end
end