Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #66 from modular-magician/codegen-pr-1233
Browse files Browse the repository at this point in the history
Add negative tests for nonexistent resources
  • Loading branch information
slevenick authored Jan 14, 2019
2 parents a514215 + 991e429 commit 003ca6b
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/resources/google_compute_disk.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ describe.one do
end
end
end
describe google_compute_disk(project: 'chef-gcp-inspec', name: 'nonexistent', zone: 'zone') do
it { should_not exist }
end
```

## Properties
Expand Down
4 changes: 4 additions & 0 deletions docs/resources/google_compute_ssl_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ describe google_compute_ssl_policy(project: 'chef-gcp-inspec', name: 'inspec-gcp
its('custom_features') { should include 'TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384' }
its('custom_features') { should include 'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384' }
end
describe google_compute_ssl_policy(project: 'chef-gcp-inspec', name: 'nonexistent') do
it { should_not exist }
end
```

## Properties
Expand Down
4 changes: 4 additions & 0 deletions docs/resources/google_pubsub_subscription.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ describe google_pubsub_subscription(project: '', name: 'inspec-gcp-subscription'
it { should exist }
end
describe google_pubsub_subscription(project: '', name: 'nonexistent') do
it { should_not exist }
end
```

## Properties
Expand Down
3 changes: 3 additions & 0 deletions docs/resources/google_pubsub_topic.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ describe google_pubsub_topic(project: '', name: 'inspec-gcp-topic') do
it { should exist }
end
describe google_pubsub_topic(project: '', name: 'nonexistent') do
it { should_not exist }
end
```

## Properties
Expand Down
4 changes: 4 additions & 0 deletions test/integration/verify/controls/google_compute_disk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@
end
end
end

describe google_compute_disk(project: gcp_project_id, name: 'nonexistent', zone: gcp_zone) do
it { should_not exist }
end
end
4 changes: 4 additions & 0 deletions test/integration/verify/controls/google_compute_ssl_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@
its('custom_features') { should include ssl_policy['custom_feature'] }
its('custom_features') { should include ssl_policy['custom_feature2'] }
end

describe google_compute_ssl_policy(project: gcp_project_id, name: 'nonexistent') do
it { should_not exist }
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@
describe google_pubsub_subscription(project: gcp_project_id, name: subscription['name']) do
it { should exist }
end

describe google_pubsub_subscription(project: gcp_project_id, name: 'nonexistent') do
it { should_not exist }
end
end
4 changes: 4 additions & 0 deletions test/integration/verify/controls/google_pubsub_topic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@
describe google_pubsub_topic(project: gcp_project_id, name: topic['name']) do
it { should exist }
end

describe google_pubsub_topic(project: gcp_project_id, name: 'nonexistent') do
it { should_not exist }
end
end

0 comments on commit 003ca6b

Please sign in to comment.