A google_storage_bucket_object is used to test a Google BucketObject resource
describe google_storage_bucket_object(bucket: 'bucket-with-object', object: 'image1') do
it { should exist }
its('size.to_i') { should be > 0 }
its('time_created') { should be > Time.now - 60*60*24*10 }
its('time_updated') { should be > Time.now - 60*60*24*10 }
end
describe google_storage_bucket_object(bucket: 'bucket-with-object', object: "nonexistent") do
it { should_not exist }
end
describe google_storage_bucket_object(bucket: 'bucket-buvsjjcndqz', object: 'bucket-object-pmxbiikq') do
it { should exist }
end
describe google_storage_bucket_object(bucket: 'bucket-buvsjjcndqz', object: 'bucket-object-pmxbiikq') do
its('size') { should be > 0 }
end
describe google_storage_bucket_object(bucket: 'bucket-buvsjjcndqz', object: 'bucket-object-pmxbiikq') do
its('content_type') { should eq "text/plain; charset=utf-8" }
end
describe google_storage_bucket_object(bucket: 'bucket-buvsjjcndqz', object: 'bucket-object-pmxbiikq') do
its('time_created_date') { should be > Time.now - 365*60*60*24*10 }
end
describe google_storage_bucket_object(bucket: 'bucket-buvsjjcndqz', object: 'bucket-object-pmxbiikq') do
its('time_updated') { should be > Time.now - 365*60*60*24*10 }
end
Properties that can be accessed from the google_storage_bucket_object resource:
bucketobjectcontent_typecrc32cetaggenerationidmd5_hashmedia_linkmetagenerationnamesizestorage_classtime_createdtime_deletedtime_storage_class_updatedtime_updatedEnsure the Google Cloud Storage is enabled for the current project.
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/google_storage_bucket_object/