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_create_tests.rb
2014-02-16 01:06:49 +02:00

21 lines
806 B
Ruby

Shindo.tests("Fog::Compute[:fogdocker] | image_create request", 'fogdocker') do
compute = Fog::Compute[:fogdocker]
tests("Create image") do
response = compute.image_create({'fromImage' => 'mattdm/fedora', 'repo'=>'test', 'tag'=>'create_image'})
test("should be a kind of Hash") { response.kind_of? Hash}
test("should have an id") { !response['id'].nil? && !response['id'].empty? }
end
tests("Fail Creating image") do
begin
response = compute.image_create('fromImage' => 'not/exists')
test("should be a kind of Hash") { response.kind_of? Hash} #mock never raise exceptions
rescue => e
#should raise missing command in the create attributes.
test("error should be a kind of Docker::Error") { e.kind_of? Docker::Error::ServerError}
end
end
end