knife-google 3.3.6 → 3.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/knife-google/version.rb +1 -1
- metadata +2 -33
- data/.expeditor/config.yml +0 -41
- data/.expeditor/update_version.sh +0 -12
- data/.github/CODEOWNERS +0 -4
- data/.github/ISSUE_TEMPLATE.md +0 -21
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -14
- data/.gitignore +0 -26
- data/.rspec +0 -3
- data/.travis.yml +0 -27
- data/CHANGELOG.md +0 -252
- data/Gemfile +0 -30
- data/README.md +0 -305
- data/RELEASE_NOTES.md +0 -18
- data/Rakefile +0 -35
- data/TESTING.md +0 -48
- data/VERSION +0 -1
- data/knife-google.gemspec +0 -25
- data/spec/cloud/google_service_helpers_spec.rb +0 -119
- data/spec/cloud/google_service_spec.rb +0 -1021
- data/spec/google_disk_create_spec.rb +0 -86
- data/spec/google_disk_delete_spec.rb +0 -78
- data/spec/google_disk_list_spec.rb +0 -107
- data/spec/google_project_quotas_spec.rb +0 -77
- data/spec/google_region_list_spec.rb +0 -79
- data/spec/google_region_quotas_spec.rb +0 -122
- data/spec/google_server_create_spec.rb +0 -243
- data/spec/google_server_delete_spec.rb +0 -53
- data/spec/google_server_list_spec.rb +0 -91
- data/spec/google_server_show_spec.rb +0 -74
- data/spec/google_zone_list_spec.rb +0 -73
@@ -1,73 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
#
|
3
|
-
# Author:: Chef Partner Engineering (<partnereng@chef.io>)
|
4
|
-
# Copyright:: Copyright (c) 2016 Chef Software, Inc.
|
5
|
-
# License:: Apache License, Version 2.0
|
6
|
-
#
|
7
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
# See the License for the specific language governing permissions and
|
17
|
-
# limitations under the License.
|
18
|
-
#
|
19
|
-
|
20
|
-
require "spec_helper"
|
21
|
-
require "chef/knife/google_zone_list"
|
22
|
-
require "support/shared_examples_for_command"
|
23
|
-
|
24
|
-
class Tester
|
25
|
-
include Chef::Knife::Cloud::GoogleServiceHelpers
|
26
|
-
end
|
27
|
-
|
28
|
-
describe Chef::Knife::Cloud::GoogleZoneList do
|
29
|
-
let(:tester) { Tester.new }
|
30
|
-
let(:command) { described_class.new }
|
31
|
-
let(:service) { double("service") }
|
32
|
-
|
33
|
-
before do
|
34
|
-
allow(command).to receive(:service).and_return(service)
|
35
|
-
end
|
36
|
-
|
37
|
-
it_behaves_like Chef::Knife::Cloud::Command, described_class.new
|
38
|
-
|
39
|
-
describe "#validate_params!" do
|
40
|
-
it "checks for missing config values" do
|
41
|
-
expect(command).to receive(:check_for_missing_config_values!)
|
42
|
-
|
43
|
-
command.validate_params!
|
44
|
-
end
|
45
|
-
|
46
|
-
it "raises an exception if the gce_project is missing" do
|
47
|
-
ui = double("ui")
|
48
|
-
expect(tester).to receive(:ui).and_return(ui)
|
49
|
-
expect(tester).to receive(:locate_config_value).with(:gce_project).and_return(nil)
|
50
|
-
expect(ui).to receive(:error).with("The following required parameters are missing: gce_project")
|
51
|
-
expect { tester.check_for_missing_config_values! }.to raise_error(RuntimeError)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
describe "#query_resource" do
|
56
|
-
it "uses the service to list zones" do
|
57
|
-
expect(service).to receive(:list_zones).and_return("zones")
|
58
|
-
expect(command.query_resource).to eq("zones")
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
describe "#format_status_value" do
|
63
|
-
it "returns green when the status is up" do
|
64
|
-
expect(command.ui).to receive(:color).with("up", :green)
|
65
|
-
command.format_status_value("up")
|
66
|
-
end
|
67
|
-
|
68
|
-
it "returns red when the status is stopped" do
|
69
|
-
expect(command.ui).to receive(:color).with("stopped", :red)
|
70
|
-
command.format_status_value("stopped")
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|