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/container_create_tests.rb

22 lines
818 B
Ruby
Raw Normal View History

2014-02-15 18:06:49 -05:00
Shindo.tests("Fog::Compute[:fogdocker] | container_create request", 'fogdocker') do
compute = Fog::Compute[:fogdocker]
name_base = Time.now.to_i
tests("Create Container") do
response = compute.container_create(:name => 'fog-'+name_base.to_s, 'image' => 'mattdm/fedora:f19','Cmd' => ['date'] )
test("should be a kind of Hash") { response.kind_of? Hash}
end
tests("Fail Creating Container") do
begin
response = compute.container_create(:name => 'fog-'+name_base.to_s, 'image' => 'mattdm/fedora:f19')
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