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:
parent
aecd8fe2bd
commit
8f76f79341
4 changed files with 12 additions and 4 deletions
|
@ -50,6 +50,8 @@ module Fog
|
||||||
def classic_link_enabled?
|
def classic_link_enabled?
|
||||||
requires :identity
|
requires :identity
|
||||||
service.describe_vpc_classic_link(:vpc_ids => [self.identity]).body['vpcSet'].first['classicLinkEnabled']
|
service.describe_vpc_classic_link(:vpc_ids => [self.identity]).body['vpcSet'].first['classicLinkEnabled']
|
||||||
|
rescue
|
||||||
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def enable_classic_link
|
def enable_classic_link
|
||||||
|
@ -65,6 +67,8 @@ module Fog
|
||||||
def classic_link_dns_enabled?
|
def classic_link_dns_enabled?
|
||||||
requires :identity
|
requires :identity
|
||||||
service.describe_vpc_classic_link_dns_support(:vpc_ids => [self.identity]).body['vpcs'].first['classicLinkDnsSupported']
|
service.describe_vpc_classic_link_dns_support(:vpc_ids => [self.identity]).body['vpcs'].first['classicLinkDnsSupported']
|
||||||
|
rescue
|
||||||
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def enable_classic_link_dns
|
def enable_classic_link_dns
|
||||||
|
|
|
@ -29,7 +29,9 @@ module Fog
|
||||||
class Mock
|
class Mock
|
||||||
def disable_vpc_classic_link_dns_support(vpc_id)
|
def disable_vpc_classic_link_dns_support(vpc_id)
|
||||||
response = Excon::Response.new
|
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
|
vpc['classicLinkDnsSupport'] = false
|
||||||
response.body = {
|
response.body = {
|
||||||
'requestId' => Fog::AWS::Mock.request_id,
|
'requestId' => Fog::AWS::Mock.request_id,
|
||||||
|
|
|
@ -29,7 +29,9 @@ module Fog
|
||||||
class Mock
|
class Mock
|
||||||
def enable_vpc_classic_link_dns_support(vpc_id)
|
def enable_vpc_classic_link_dns_support(vpc_id)
|
||||||
response = Excon::Response.new
|
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
|
vpc['classicLinkDnsSupport'] = true
|
||||||
response.body = {
|
response.body = {
|
||||||
'requestId' => Fog::AWS::Mock.request_id,
|
'requestId' => Fog::AWS::Mock.request_id,
|
||||||
|
|
|
@ -140,7 +140,7 @@ Shindo.tests('Fog::Compute[:aws] | vpc requests', ['aws']) do
|
||||||
|
|
||||||
tests("enable_vpc_classic_link").returns(true) do
|
tests("enable_vpc_classic_link").returns(true) do
|
||||||
Fog::Compute[:aws].enable_vpc_classic_link @vpc_id
|
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']
|
body['vpcSet'].first['classicLinkEnabled']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ Shindo.tests('Fog::Compute[:aws] | vpc requests', ['aws']) do
|
||||||
|
|
||||||
tests("disable_vpc_classic_link").returns(false) do
|
tests("disable_vpc_classic_link").returns(false) do
|
||||||
Fog::Compute[:aws].disable_vpc_classic_link @vpc_id
|
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']
|
body['vpcSet'].first['classicLinkEnabled']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue