1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/bluebox/requests/compute/template_tests.rb
2012-02-16 18:48:50 -08:00

37 lines
979 B
Ruby

Shindo.tests('Fog::Compute[:bluebox] | template requests', ['bluebox']) do
@template_format = {
'created' => String,
'description' => String,
'id' => String,
'public' => Fog::Boolean,
'locations' => [ String ],
'status' => String
}
tests('success') do
@template_id = compute_providers[:bluebox][:server_attributes][:image_id]
tests("get_template('#{@template_id}')").formats(@template_format) do
pending if Fog.mocking?
Fog::Compute[:bluebox].get_template(@template_id).body
end
tests("get_templates").formats([@template_format]) do
pending if Fog.mocking?
Fog::Compute[:bluebox].get_templates.body
end
end
tests('failure') do
tests("get_template('00000000-0000-0000-0000-000000000000')").raises(Fog::Compute::Bluebox::NotFound) do
pending if Fog.mocking?
Fog::Compute[:bluebox].get_template('00000000-0000-0000-0000-000000000000')
end
end
end