Permalink
Browse files

[rackspace] consolidate flavor tests

  • Loading branch information...
1 parent 0c26a57 commit fa47149533479ba6e554fef13705cf99a9a7f77d @geemus geemus committed with May 31, 2010
@@ -27,13 +27,6 @@ module Servers
module Formats
- FLAVOR = {
- 'disk' => Integer,
- 'id' => Integer,
- 'name' => String,
- 'ram' => Integer
- }
-
IMAGE = {
'created' => String,
'id' => Integer,
@@ -0,0 +1,34 @@
+Shindo.tests('Rackspace::Servers | flavor requests', ['rackspace']) do
+
+ @flavor_format = {
+ 'disk' => Integer,
+ 'id' => Integer,
+ 'name' => String,
+ 'ram' => Integer
+ }
+
+ tests('success') do
+
+ tests('#get_flavor_details(1)').formats(@flavor_format) do
+ Rackspace[:servers].get_flavor_details(1).body['flavor']
+ end
+
+ tests('#list_flavors').formats({'flavors' => [Rackspace::Servers::Formats::SUMMARY]}) do
+ Rackspace[:servers].list_flavors.body
+ end
+
+ tests('#list_flavors_detail').formats({'flavors' => [@flavor_format]}) do
+ Rackspace[:servers].list_flavors_detail.body
+ end
+
+ end
+
+ tests('failure') do
+
+ tests('#get_flavor_details(0)').raises(Fog::Rackspace::Servers::NotFound) do
+ Rackspace[:servers].get_flavor_details(0)
+ end
+
+ end
+
+end
@@ -1,16 +0,0 @@
-Shindo.tests('Rackspace::Servers#get_flavor_details', 'rackspace') do
- tests('success') do
-
- tests('#get_flavor_details(1)').formats(Rackspace::Servers::Formats::FLAVOR) do
- Rackspace[:servers].get_flavor_details(1).body['flavor']
- end
-
- end
- tests('failure') do
-
- tests('#get_flavor_details(0)').raises(Excon::Errors::NotFound) do
- Rackspace[:servers].get_flavor_details(0)
- end
-
- end
-end
@@ -1,9 +0,0 @@
-Shindo.tests('Rackspace::Servers#list_flavors_detail', 'rackspace') do
- tests('success') do
-
- tests('#list_flavors_detail').formats({'flavors' => [Rackspace::Servers::Formats::FLAVOR]}) do
- Rackspace[:servers].list_flavors_detail.body
- end
-
- end
-end
@@ -1,9 +0,0 @@
-Shindo.tests('Rackspace::Servers#list_flavors', 'rackspace') do
- tests('success') do
-
- tests('#list_flavors').formats({'flavors' => [Rackspace::Servers::Formats::SUMMARY]}) do
- Rackspace[:servers].list_flavors.body
- end
-
- end
-end

0 comments on commit fa47149

Please sign in to comment.