forked from googleapis/google-cloud-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject_test.rb
More file actions
51 lines (44 loc) · 1.62 KB
/
project_test.rb
File metadata and controls
51 lines (44 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require_relative "helper"
require_relative "../storage_get_service_account"
require_relative "../storage_restore_bucket"
describe "Storage Quickstart" do
let(:project) { Google::Cloud::Storage.new }
let(:bucket) { fixture_bucket }
it "get_service_account" do
email = nil
out, _err = capture_io do
email = get_service_account
end
assert_includes out,
"The GCS service account for project #{project.project_id} is: #{project.service_account_email}"
assert_includes out, "@gs-project-accounts.iam.gserviceaccount.com"
end
end
describe "storage_soft_deleted_bucket" do
let(:new_bucket_name) { random_bucket_name }
let(:new_bucket) { create_bucket_helper new_bucket_name }
let(:generation) { new_bucket.generation }
before do
delete_bucket_helper new_bucket.name
end
it "restores a soft deleted bucket" do
# restoring deleted bucket
_out, _err = capture_io do
restore_bucket bucket_name: new_bucket.name, generation: generation
end
assert "#{new_bucket.name} Bucket restored"
end
end