1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/slicehost/requests/compute/flavor_tests.rb
2010-09-09 17:50:38 -07:00

30 lines
602 B
Ruby

Shindo.tests('Slicehost::Compute | flavor requests', ['slicehost']) do
@flavor_format = {
'id' => Integer,
'name' => String,
'price' => Integer,
'ram' => Integer
}
tests('success') do
tests('#get_flavor(1)').formats(@flavor_format) do
Slicehost[:compute].get_flavor(1).body
end
tests('#get_flavors').formats({ 'flavors' => [@flavor_format] }) do
Slicehost[:compute].get_flavors.body
end
end
tests('failure') do
tests('#get_flavor(0)').raises(Excon::Errors::Forbidden) do
Slicehost[:compute].get_flavor(0)
end
end
end