diff --git a/spec/aws/requests/compute/describe_images_spec.rb b/spec/aws/requests/compute/describe_images_spec.rb deleted file mode 100644 index b74ee2ea7..000000000 --- a/spec/aws/requests/compute/describe_images_spec.rb +++ /dev/null @@ -1,44 +0,0 @@ -require File.dirname(__FILE__) + '/../../../spec_helper' - -describe 'Compute.describe_images' do - describe 'success' do - - it "should return proper attributes with no params" do - actual = AWS[:compute].describe_images - actual.body['requestId'].should be_a(String) - image = actual.body['imagesSet'].first - image['architecture'].should be_a(String) - image['imageId'].should be_a(String) - image['imageLocation'].should be_a(String) - image['imageOwnerId'].should be_a(String) - image['imageState'].should be_a(String) - image['imageType'].should be_a(String) - [false, true].should include(image['isPublic']) - image['kernelId'].should be_a(String) if image['kernelId'] - image['platform'].should be_a(String) if image['platform'] - image['ramdiskId'].should be_a(String) if image['ramdiskId'] - image['rootDeviceName'].should be_a(String) if image['rootDeviceName'] - ["ebs","instance-store"].should include(image['rootDeviceType']) - image['rootDeviceName'].should be_a(String) if image['rootDeviceName'] - end - - it "should return proper attributes with params" do - actual = AWS[:compute].describe_images('ImageId' => GENTOO_AMI) - actual.body['requestId'].should be_a(String) - image = actual.body['imagesSet'].first - image['architecture'].should be_a(String) - image['imageId'].should be_a(String) - image['imageLocation'].should be_a(String) - image['imageOwnerId'].should be_a(String) - image['imageState'].should be_a(String) - image['imageType'].should be_a(String) - [false, true].should include(image['isPublic']) - image['kernelId'].should be_a(String) if image['kernelId'] - image['platform'].should be_a(String) if image['platform'] - image['ramdiskId'].should be_a(String) if image['ramdiskId'] - ["ebs","instance-store"].should include(image['rootDeviceType']) - image['rootDeviceName'].should be_a(String) if image['rootDeviceName'] - end - - end -end diff --git a/tests/aws/requests/compute/image_tests.rb b/tests/aws/requests/compute/image_tests.rb new file mode 100644 index 000000000..6a5d83c01 --- /dev/null +++ b/tests/aws/requests/compute/image_tests.rb @@ -0,0 +1,41 @@ +Shindo.tests('AWS::Compute | image requests', ['aws']) do + + @images_format = { + 'imagesSet' => [{ + 'architecture' => String, + 'blockDeviceMapping' =>[], + 'imageId' => String, + 'imageLocation' => String, + 'imageOwnerId' => String, + 'imageState' => String, + 'imageType' => String, + 'isPublic' => Fog::Boolean, + 'kernelId' => String, + 'productCodes' => [], + 'ramdiskId' => String, + 'rootDeviceType' => String + }], + 'requestId' => String, + } + + tests('success') do + + # the result for this is HUGE an relatively uninteresting...de + # tests("#describe_images").formats(@images_format) do + # AWS[:compute].describe_images.body + # end + + tests("#describe_images('ImageId' => '#{GENTOO_AMI}')").formats(@images_format) do + AWS[:compute].describe_images('ImageId' => GENTOO_AMI).body + end + + end + + tests('failure') do + + tests("#describe_images('ImageId' => 'ami-00000000')").raises(Fog::AWS::Compute::Error) do + AWS[:compute].describe_regions('ImageId' => 'ami-00000000') + end + end + +end