1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[ec2] convert availability zone specs to shindo

This commit is contained in:
geemus 2010-05-23 14:35:31 -07:00
parent b26ad4f879
commit ba1b0e41b6
4 changed files with 36 additions and 24 deletions

View file

@ -1,23 +0,0 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
describe 'EC2.describe_availability_zones' do
describe 'success' do
it "should return proper attributes with no params" do
actual = AWS[:ec2].describe_availability_zones
zone = actual.body['availabilityZoneInfo'].first
zone['regionName'].should be_a(String)
zone['zoneName'].should be_a(String)
zone['zoneState'].should be_a(String)
end
it "should return proper attribute with params" do
actual = AWS[:ec2].describe_availability_zones(['us-east-1a'])
zone = actual.body['availabilityZoneInfo'].first
zone['regionName'].should be_a(String)
zone['zoneName'].should be_a(String)
zone['zoneState'].should be_a(String)
end
end
end

View file

@ -41,6 +41,15 @@ module AWS
'requestId' => String
}
AVAILABILITY_ZONES = {
'availabilityZoneInfo' => [{
'regionName' => String,
'zoneName' => String,
'zoneState' => String
}],
'requestId' => String
}
BASIC = {
'requestId' => String,
'return' => ::Fog::Boolean

View file

@ -0,0 +1,23 @@
Shindo.tests('AWS::EC2 | availability zone requests', ['aws']) do
tests('success') do
tests('#describe_availability_zones').formats(AWS::EC2::Formats::AVAILABILITY_ZONES) do
AWS[:ec2].describe_availability_zones.body
end
tests("#describe_availability_zones('us-east-1a')").formats(AWS::EC2::Formats::AVAILABILITY_ZONES) do
AWS[:ec2].describe_availability_zones('us-east-1a').body
end
end
tests('failure') do
tests("#describe_availability_zones('not-a-zone')").raises(Excon::Errors::BadRequest) do
AWS[:ec2].describe_availability_zones('not-a-zone')
end
end
end

View file

@ -1,4 +1,5 @@
Shindo.tests('AWS::EC2 | region requests', ['aws']) do
tests('success') do
tests("#describe_regions").formats(AWS::EC2::Formats::REGIONS) do
@ -10,10 +11,12 @@ Shindo.tests('AWS::EC2 | region requests', ['aws']) do
end
end
tests('failure') do
tests("#describe_regions('not-a-region')").raises(Excon::Errors::BadRequest) do
AWS[:ec2].describe_regions('not-a-region').body
AWS[:ec2].describe_regions('not-a-region')
end
end
end