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

spec and mock fixes

This commit is contained in:
Eugene Howe 2017-03-17 13:27:54 -04:00
parent aecd8fe2bd
commit 8f76f79341
4 changed files with 12 additions and 4 deletions

View file

@ -50,6 +50,8 @@ module Fog
def classic_link_enabled?
requires :identity
service.describe_vpc_classic_link(:vpc_ids => [self.identity]).body['vpcSet'].first['classicLinkEnabled']
rescue
nil
end
def enable_classic_link
@ -65,6 +67,8 @@ module Fog
def classic_link_dns_enabled?
requires :identity
service.describe_vpc_classic_link_dns_support(:vpc_ids => [self.identity]).body['vpcs'].first['classicLinkDnsSupported']
rescue
nil
end
def enable_classic_link_dns

View file

@ -29,7 +29,9 @@ module Fog
class Mock
def disable_vpc_classic_link_dns_support(vpc_id)
response = Excon::Response.new
vpc = self.data[:vpcs].find { |v| v['vpcId'] == vpc_id }
unless vpc = self.data[:vpcs].find { |v| v['vpcId'] == vpc_id }
raise Fog::Compute::AWS::NotFound.new("The VPC '#{vpc_id}' does not exist")
end
vpc['classicLinkDnsSupport'] = false
response.body = {
'requestId' => Fog::AWS::Mock.request_id,

View file

@ -29,7 +29,9 @@ module Fog
class Mock
def enable_vpc_classic_link_dns_support(vpc_id)
response = Excon::Response.new
vpc = self.data[:vpcs].find { |v| v['vpcId'] == vpc_id }
unless vpc = self.data[:vpcs].find { |v| v['vpcId'] == vpc_id }
raise Fog::Compute::AWS::NotFound.new("The VPC '#{vpc_id}' does not exist")
end
vpc['classicLinkDnsSupport'] = true
response.body = {
'requestId' => Fog::AWS::Mock.request_id,

View file

@ -140,7 +140,7 @@ Shindo.tests('Fog::Compute[:aws] | vpc requests', ['aws']) do
tests("enable_vpc_classic_link").returns(true) do
Fog::Compute[:aws].enable_vpc_classic_link @vpc_id
body = Fog::Compute[:aws].describe_vpc_classic_link(:vpc_ids => [@vpc_id])
body = Fog::Compute[:aws].describe_vpc_classic_link(:vpc_ids => [@vpc_id]).body
body['vpcSet'].first['classicLinkEnabled']
end
@ -198,7 +198,7 @@ Shindo.tests('Fog::Compute[:aws] | vpc requests', ['aws']) do
tests("disable_vpc_classic_link").returns(false) do
Fog::Compute[:aws].disable_vpc_classic_link @vpc_id
body = Fog::Compute[:aws].describe_vpc_classic_link(:vpc_ids => [@vpc_id])
body = Fog::Compute[:aws].describe_vpc_classic_link(:vpc_ids => [@vpc_id]).body
body['vpcSet'].first['classicLinkEnabled']
end