Skip to content

Commit

Permalink
Merge pull request #574 from alpineriveredge/vpe_subnet
Browse files Browse the repository at this point in the history
Make 'vpc_endponts have_subnet' testable by name
  • Loading branch information
k1LoW authored Oct 24, 2022
2 parents 0793e0d + c89d8aa commit 9a6a12d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/_resource_types/vpc_endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ end
```ruby
describe vpc_endpoints('my-vpc-endpoint') do
it { should have_subnet('subnet-abc123') }
it { should have_subnet('my-subnet') }
end
```

Expand Down
1 change: 1 addition & 0 deletions doc/resource_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -4001,6 +4001,7 @@ end
```ruby
describe vpc_endpoints('my-vpc-endpoint') do
it { should have_subnet('subnet-abc123') }
it { should have_subnet('my-subnet') }
end
```

Expand Down
6 changes: 6 additions & 0 deletions lib/awspec/type/vpc_endpoints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ def has_subnet?(subnet_id)
subnet == subnet_id
end
return true if ret

res = find_subnet(subnet_id)
ret = subnets.find do |subnet|
subnet == res.subnet_id
end
return true if ret
end
end
end

0 comments on commit 9a6a12d

Please sign in to comment.