awspec 0.24.1 → 0.24.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a10eaa86514c0ae91094657961105fcb5f9ac41a
4
- data.tar.gz: 57bcad942d927c04524a515b12c08c046a43c0dc
3
+ metadata.gz: 39292abd8aa1e62f4e4b5fa387790bb195ecbbcd
4
+ data.tar.gz: 93aaf5af8a1db102d1bd4de00a4223f16e4fef52
5
5
  SHA512:
6
- metadata.gz: e8e94a86368a27e40ae57255d2a30f097fea631e0c2779ac6ca887d2efdca42db992a409516353d72a1c20138fe47ee900639b14a09baa955115266204a2da82
7
- data.tar.gz: b349d5f781dc8272957504f1941351268bf8cbd4a13ad3ce44b71d9803d914279731876dc13c58d5c74cbf69026b7ebfe21fa006ed81e9e7c1676d2ea1abb224
6
+ metadata.gz: 695b9f482584822502cc969f791f6d406394778458f968900382883015791196ddd8db20b73811e68e534aff8d5403aaa88e8e0a608f44b668561f1548ee29a5
7
+ data.tar.gz: 3df34ad6f03d73a862fa3f2cf8e142d6df1a17f799b8ab076d42a186dc02dab690a788be761fdfca2cd9c524a4e4e539366ef2662eda9674355bdb63737479b2
@@ -1,7 +1,7 @@
1
1
  ### exist
2
2
 
3
3
  ```ruby
4
- describe s3('my-bucket') do
4
+ describe s3_bucket('my-bucket') do
5
5
  it { should exist }
6
6
  end
7
7
  ```
@@ -9,19 +9,19 @@ end
9
9
  ### have_acl_grant
10
10
 
11
11
  ```ruby
12
- describe s3('my-bucket') do
12
+ describe s3_bucket('my-bucket') do
13
+ its(:acl_owner) { should eq 'my-bucket-owner' }
13
14
  its(:acl_grants_count) { should eq 3 }
14
15
  it { should have_acl_grant(grantee: 'my-bucket-owner', permission: 'FULL_CONTROL') }
15
- it { should have_acl_grant(grantee: 'my-bucket-write-only', permission: 'WRITE') }
16
- it { should have_acl_grant(grantee: 'my-bucket-read-only', permission: 'READ') }
17
- its(:acl_owner) { should eq 'my-bucket-owner' }
16
+ it { should have_acl_grant(grantee: 'http://acs.amazonaws.com/groups/s3/LogDelivery', permission: 'WRITE') }
17
+ it { should have_acl_grant(grantee: '68f4bb06b094152df53893bfba57760e', permission: 'READ') }
18
18
  end
19
19
  ```
20
20
 
21
21
  ### have_object
22
22
 
23
23
  ```ruby
24
- describe s3('my-bucket') do
24
+ describe s3_bucket('my-bucket') do
25
25
  it { should have_object('path/to/object') }
26
26
  end
27
27
  ```
@@ -276,12 +276,36 @@ S3Bucket resource type.
276
276
 
277
277
  ### exist
278
278
 
279
+ ```ruby
280
+ describe s3_bucket('my-bucket') do
281
+ it { should exist }
282
+ end
283
+ ```
284
+
285
+
279
286
  ### have_acl_grant
280
287
 
288
+ ```ruby
289
+ describe s3_bucket('my-bucket') do
290
+ its(:acl_owner) { should eq 'my-bucket-owner' }
291
+ its(:acl_grants_count) { should eq 3 }
292
+ it { should have_acl_grant(grantee: 'my-bucket-owner', permission: 'FULL_CONTROL') }
293
+ it { should have_acl_grant(grantee: 'http://acs.amazonaws.com/groups/s3/LogDelivery', permission: 'WRITE') }
294
+ it { should have_acl_grant(grantee: '68f4bb06b094152df53893bfba57760e', permission: 'READ') }
295
+ end
296
+ ```
297
+
298
+
281
299
  ### have_cors_rule
282
300
 
283
301
  ### have_object
284
302
 
303
+ ```ruby
304
+ describe s3_bucket('my-bucket') do
305
+ it { should have_object('path/to/object') }
306
+ end
307
+ ```
308
+
285
309
  ### have_policy
286
310
 
287
311
  #### its(:acl_grants_count), its(:acl_owner), its(:cors_rules_count), its(:name), its(:creation_date)
@@ -22,9 +22,10 @@ module Awspec::Generator
22
22
  end
23
23
 
24
24
  def grant_linetemplate
25
- template = <<-'EOF'
26
- it { should have_acl_grant(grantee: '<%= grant.grantee.display_name %>', permission: '<%= grant.permission %>') }
27
- EOF
25
+ grantee = 'grant.grantee.display_name || grant.grantee.uri || grant.grantee.id'
26
+ template = <<-EOF
27
+ it { should have_acl_grant(grantee: '<%= #{grantee} %>', permission: '<%= grant.permission %>') }
28
+ EOF
28
29
  template
29
30
  end
30
31
 
@@ -32,11 +33,11 @@ EOF
32
33
  template = <<-'EOF'
33
34
  describe s3_bucket('<%= bucket.name %>') do
34
35
  it { should exist }
36
+ its(:acl_owner) { should eq '<%= acl.owner.display_name %>' }
35
37
  its(:acl_grants_count) { should eq <%= acl.grants.count %> }
36
38
  <% grant_specs.each do |line| %>
37
39
  <%= line %>
38
40
  <% end %>
39
- its(:acl_owner) { should eq '<%= acl.owner.display_name %>' }
40
41
  end
41
42
  EOF
42
43
  template
@@ -24,14 +24,14 @@ Aws.config[:s3] = {
24
24
  },
25
25
  {
26
26
  grantee: {
27
- display_name: 'my-bucket-write-only',
27
+ uri: 'http://acs.amazonaws.com/groups/s3/LogDelivery',
28
28
  type: 'CanonicalUser'
29
29
  },
30
30
  permission: 'WRITE'
31
31
  },
32
32
  {
33
33
  grantee: {
34
- display_name: 'my-bucket-read-only',
34
+ id: '68f4bb06b094152df53893bfba57760e',
35
35
  type: 'CanonicalUser'
36
36
  },
37
37
  permission: 'READ'
@@ -19,9 +19,8 @@ module Awspec::Type
19
19
  def has_acl_grant?(grantee:, permission:)
20
20
  @acl = find_bucket_acl(@id)
21
21
  @acl.grants.find do |grant|
22
- next false if !grantee.nil? && grant.grantee.display_name != grantee && grant.grantee.id != grantee
23
- next false if !permission.nil? && grant.permission != permission
24
- true
22
+ grant.permission == permission &&
23
+ (grant.grantee.display_name == grantee || grant.grantee.uri == grantee || grant.grantee.id == grantee)
25
24
  end
26
25
  end
27
26
 
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.24.1'
2
+ VERSION = '0.24.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.1
4
+ version: 0.24.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
@@ -201,7 +201,7 @@ files:
201
201
  - doc/_resource_types/rds_db_parameter_group.md
202
202
  - doc/_resource_types/route53_hosted_zone.md
203
203
  - doc/_resource_types/route_table.md
204
- - doc/_resource_types/s3.md
204
+ - doc/_resource_types/s3_bucket.md
205
205
  - doc/_resource_types/security_group.md
206
206
  - doc/_resource_types/ses_identity.md
207
207
  - doc/_resource_types/subnet.md