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/flavor_tests.rb
2010-05-31 21:39:17 -07:00

30 lines
590 B
Ruby

Shindo.tests('Slicehost | 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[:slices].get_flavor(1).body
end
tests('#get_flavors').formats({ 'flavors' => [@flavor_format] }) do
Slicehost[:slices].get_flavors.body
end
end
tests('failure') do
tests('#get_flavor(0)').raises(Excon::Errors::Forbidden) do
Slicehost[:slices].get_flavor(0)
end
end
end