mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[ec2] convert region specs to shindo
This commit is contained in:
parent
951a7d66e8
commit
b26ad4f879
3 changed files with 27 additions and 21 deletions
|
@ -1,21 +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_regions
|
||||
zone = actual.body['regionInfo'].first
|
||||
zone['regionEndpoint'].should be_a(String)
|
||||
zone['regionName'].should be_a(String)
|
||||
end
|
||||
|
||||
it "should return proper attribute with params" do
|
||||
actual = AWS[:ec2].describe_regions(['us-east-1'])
|
||||
zone = actual.body['regionInfo'].first
|
||||
zone['regionEndpoint'].should be_a(String)
|
||||
zone['regionName'].should be_a(String)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
|
@ -46,6 +46,14 @@ module AWS
|
|||
'return' => ::Fog::Boolean
|
||||
}
|
||||
|
||||
REGIONS = {
|
||||
'regionInfo' => [{
|
||||
'regionEndpoint' => String,
|
||||
'regionName' => String
|
||||
}],
|
||||
'requestId' => String
|
||||
}
|
||||
|
||||
SECURITY_GROUPS = {
|
||||
'requestId' => String,
|
||||
'securityGroupInfo' => [{
|
||||
|
|
19
tests/aws/requests/ec2/region_tests.rb
Normal file
19
tests/aws/requests/ec2/region_tests.rb
Normal file
|
@ -0,0 +1,19 @@
|
|||
Shindo.tests('AWS::EC2 | region requests', ['aws']) do
|
||||
tests('success') do
|
||||
|
||||
tests("#describe_regions").formats(AWS::EC2::Formats::REGIONS) do
|
||||
AWS[:ec2].describe_regions.body
|
||||
end
|
||||
|
||||
tests("#describe_regions('us-east-1')").formats(AWS::EC2::Formats::REGIONS) do
|
||||
AWS[:ec2].describe_regions('us-east-1').body
|
||||
end
|
||||
|
||||
end
|
||||
tests('failure') do
|
||||
|
||||
tests("#describe_regions('not-a-region')").raises(Excon::Errors::BadRequest) do
|
||||
AWS[:ec2].describe_regions('not-a-region').body
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue