brightbox-cli 2.1.2 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/Gemfile.lock +7 -6
- data/brightbox-cli.gemspec +2 -1
- data/lib/brightbox-cli/config/clients.rb +1 -1
- data/lib/brightbox-cli/gli_global_hooks.rb +3 -1
- data/lib/brightbox-cli/images.rb +1 -1
- data/lib/brightbox-cli/version.rb +1 -1
- data/lib/brightbox_cli.rb +1 -1
- data/spec/cassettes/Brightbox_Account/_all/when_connected_using_an_application/returns_a_collection_of_Accounts.yml +3 -3
- data/spec/cassettes/Brightbox_Account/_all/when_connected_using_an_application/returns_resources_on_the_same_connection.yml +1 -1
- data/spec/cassettes/Brightbox_Account/_all/when_connected_using_an_client/returns_a_collection_of_Accounts.yml +2 -2
- data/spec/cassettes/Brightbox_Account/_all/when_connected_using_an_client/returns_resources_on_the_same_connection.yml +1 -1
- data/spec/cassettes/Brightbox_BBConfig/_add_section/when_first_and_only_client/saves_changes_to_the_config_file.yml +1 -1
- data/spec/cassettes/Brightbox_BBConfig/_add_section/when_first_and_only_client/saves_the_default_account.yml +1 -1
- data/spec/cassettes/Brightbox_BBConfig/_add_section/when_first_and_only_client/saves_the_new_client_as_the_default.yml +1 -1
- data/spec/cassettes/Brightbox_BBConfig/_find_or_set_default_account/when_client_is_not_authenticated/does_not_raise_an_error.yml +5 -5
- data/spec/cassettes/Brightbox_BBConfig/_find_or_set_default_account/when_client_may_access_one_account/updates_the_setting.yml +5 -5
- data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_config_in_use_is_not_the_default/uses_correct_credentials.yml +1 -1
- data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_a_user_app_with_a_cached_refresh_token/caches_the_new_tokens.yml +1 -1
- data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_a_user_app_with_an_expired_refresh_token/caches_the_new_tokens.yml +2 -2
- data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_a_user_app_with_no_tokens/caches_the_new_tokens.yml +1 -1
- data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_a_user_app_with_no_tokens/prompts_user_to_retry_command.yml +1 -1
- data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_an_API_client_with_no_tokens/caches_a_new_access_token.yml +1 -1
- data/spec/cassettes/Brightbox_CloudIP/_find_all_/when_a_Cloud_IP_exists/returns_a_suitable.yml +7 -7
- data/spec/cassettes/Brightbox_FirewallPolicy/_apply_to/should_apply_firewall_policy.yml +6 -6
- data/spec/cassettes/Brightbox_FirewallPolicy/_create/should_create_firewall_policy.yml +6 -6
- data/spec/cassettes/Brightbox_FirewallPolicy/_destroy/should_destroy_firewall_policy.yml +7 -7
- data/spec/cassettes/Brightbox_FirewallPolicy/_find_all_/when_a_policy_exists/should_list_firewall_policy.yml +6 -6
- data/spec/cassettes/Brightbox_FirewallPolicy/_find_or_call/when_a_policy_exists/should_show_firewall_policy.yml +5 -5
- data/spec/cassettes/Brightbox_FirewallRule/_create/when_policy_exists/creates_the_rule_successfully.yml +6 -6
- data/spec/cassettes/Brightbox_FirewallRule/_destroy/when_rule_exists/destroys_a_rule.yml +5 -5
- data/spec/cassettes/Brightbox_FirewallRule/_find/when_rule_exists/can_display_the_result.yml +6 -6
- data/spec/cassettes/Brightbox_FirewallRule/_from_policy/when_policy_exists_with_a_rule/lists_all_rules.yml +8 -8
- data/spec/cassettes/Brightbox_Server/_destroy/when_server_exists/should_work.yml +5 -5
- data/spec/cassettes/Brightbox_Server/_find_all_/when_a_server_exists/should_print_server_list.yml +7 -7
- data/spec/cassettes/Brightbox_Server/_show/when_server_exists/shows_detailed_attributes_of_a_server.yml +8 -8
- data/spec/cassettes/Brightbox_Server/_shutdown/should_work.yml +8 -8
- data/spec/cassettes/Brightbox_Server/_start/should_work.yml +11 -11
- data/spec/cassettes/Brightbox_Server/_stop/should_work.yml +8 -8
- data/spec/cassettes/Brightbox_Server/_update/when_passing_new_group_membership/should_update_with_group.yml +10 -10
- data/spec/cassettes/Brightbox_ServerGroup/_find_all_/when_a_group_exists/list_server_groups.yml +6 -6
- data/spec/cassettes/Firewall_policies/update/when_the_policy_does_not_exist/prints_error_to_STDERR.yml +1 -1
- data/spec/cassettes/brightbox_accounts/list/_when_access_token_expired_/does_not_report_invalid_token_errors.yml +7 -7
- data/spec/cassettes/brightbox_accounts/list/_when_both_tokens_expired_/does_not_report_invalid_token_errors.yml +7 -7
- data/spec/cassettes/brightbox_accounts/list/_when_invalid_tokens_/does_not_report_invalid_token_errors.yml +7 -7
- data/spec/cassettes/brightbox_accounts/list/_when_no_tokens_/does_not_report_invalid_token_errors.yml +6 -6
- data/spec/cassettes/brightbox_accounts/list/_when_no_tokens_/reports_they_were_updated.yml +5 -5
- data/spec/cassettes/brightbox_accounts/list/_when_no_tokens_and_password_incorrect_/does_not_report_invalid_token_errors.yml +5 -5
- data/spec/cassettes/brightbox_accounts/list/_when_no_tokens_and_password_incorrect_/reports_unable_to_authenticate.yml +4 -4
- data/spec/cassettes/brightbox_accounts/list/does_not_error.yml +2 -2
- data/spec/cassettes/brightbox_cloudips/map/when_destination_is_a_server_ID/passes_the_interface_identifier_to_the_API.yml +6 -6
- data/spec/cassettes/brightbox_cloudips/map/when_destination_is_another_value/passes_the_identifier_to_the_API.yml +3 -3
- data/spec/cassettes/brightbox_config/client_add/when_adding_a_new_client/does_not_error.yml +4 -4
- data/spec/cassettes/brightbox_config/client_add/when_adding_a_new_client/sets_up_the_config.yml +4 -4
- data/spec/cassettes/brightbox_config/client_add/when_new_client_is_first_and_only_client/does_not_change_the_default_client.yml +4 -4
- data/spec/cassettes/brightbox_config/client_add/when_new_client_is_first_and_only_client/does_not_error.yml +4 -4
- data/spec/cassettes/brightbox_config/client_add/when_new_client_is_first_and_only_client/sets_this_as_the_default_client.yml +4 -4
- data/spec/cassettes/brightbox_config/client_add/when_new_client_is_first_and_only_client/sets_up_the_config.yml +4 -4
- data/spec/cassettes/brightbox_config/user_add/when_NO_config_file_on_disk/sets_up_the_config.yml +3 -3
- data/spec/cassettes/brightbox_config/user_add/when_a_default_client_is_already_set/does_not_change_the_default_client.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_application_details_in_config/does_not_error.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_application_details_in_config/sets_up_the_config.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_application_has_access_only_one_active_account/display_an_warning_about_preselected_default.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_application_has_access_only_one_active_account/does_not_error.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_application_has_access_only_one_active_account/selects_the_active_account_for_the_default.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_application_has_access_only_one_active_account/sets_up_the_config.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_application_has_access_to_multiple_accounts/display_an_warning_about_preselected_default.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_application_has_access_to_multiple_accounts/does_not_error.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_application_has_access_to_multiple_accounts/sets_up_the_config.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_new_client_is_first_and_only_client/does_not_error.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_new_client_is_first_and_only_client/does_not_prompt_to_rerun_the_command.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_new_client_is_first_and_only_client/requests_access_tokens.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_new_client_is_first_and_only_client/sets_this_as_the_default_client.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_new_client_is_first_and_only_client/sets_up_the_config.yml +3 -3
- data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments/does_not_error.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments/does_not_prompt_to_rerun_the_command.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments/requests_access_tokens.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments/sets_up_the_config.yml +2 -2
- data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments_and_api_url/does_not_error.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments_and_api_url/requests_access_tokens.yml +1 -1
- data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments_and_api_url/sets_up_the_config.yml +1 -1
- data/spec/cassettes/brightbox_database-servers/create/--allow-access_10_0_0_0/correctly_sends_API_parameters.yml +1 -1
- data/spec/cassettes/brightbox_database-servers/create/--allow-access_srv-12345_grp-12345/correctly_sends_API_parameters.yml +1 -1
- data/spec/cassettes/brightbox_database-servers/create/--engine_mysql/correctly_sends_API_parameters.yml +1 -1
- data/spec/cassettes/brightbox_database-servers/create/--engine_mysql_--engine-version_5_6/correctly_sends_API_parameters.yml +1 -1
- data/spec/cassettes/brightbox_database-servers/create/without_arguments/reports_the_new_admin_password.yml +1 -1
- data/spec/cassettes/brightbox_database-servers/create/without_arguments/reports_the_new_admin_username.yml +1 -1
- data/spec/cassettes/brightbox_database-servers/snapshot/when_database_server_active/correctly_sends_API_parameters.yml +2 -2
- data/spec/cassettes/brightbox_database-servers/snapshot/when_database_server_can_not_be_snapshotted/reports_an_error_to_the_user.yml +1 -1
- data/spec/cassettes/brightbox_database-snapshots/list/when_resources_are_available/does_not_output_to_stderr.yml +1 -1
- data/spec/cassettes/brightbox_database-snapshots/list/when_resources_are_available/outputs_table_details_to_stdout.yml +1 -1
- data/spec/cassettes/brightbox_database-snapshots/show/when_resource_exists/does_not_output_to_stderr.yml +1 -1
- data/spec/commands/accounts/list_spec.rb +6 -6
- data/spec/commands/cloudips/map_spec.rb +2 -2
- data/spec/commands/config/client_add_spec.rb +3 -3
- data/spec/commands/config/user_add_spec.rb +8 -8
- data/spec/commands/firewall_policies/update_spec.rb +5 -5
- data/spec/commands/sql/instances/create_spec.rb +5 -5
- data/spec/commands/sql/instances/snapshot_spec.rb +2 -2
- data/spec/commands/sql/snapshots/list_spec.rb +1 -1
- data/spec/commands/sql/snapshots/show_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -4
- data/spec/support/vcr.rb +0 -4
- data/spec/unit/brightbox/account/all_spec.rb +2 -2
- data/spec/unit/brightbox/account/get_spec.rb +5 -5
- data/spec/unit/brightbox/api/conn_spec.rb +1 -1
- data/spec/unit/brightbox/bb_config/add_section_spec.rb +1 -1
- data/spec/unit/brightbox/bb_config/find_or_set_default_account_spec.rb +3 -3
- data/spec/unit/brightbox/bb_config/renew_tokens_spec.rb +5 -5
- data/spec/unit/brightbox/cloud_ip/find_spec.rb +1 -1
- data/spec/unit/brightbox/config/api_client/to_fog_spec.rb +3 -3
- data/spec/unit/brightbox/config/user_application/to_fog_spec.rb +4 -4
- data/spec/unit/brightbox/firewall_policy/apply_to_spec.rb +1 -1
- data/spec/unit/brightbox/firewall_policy/create_spec.rb +1 -1
- data/spec/unit/brightbox/firewall_policy/destroy_spec.rb +1 -1
- data/spec/unit/brightbox/firewall_policy/find_or_call_spec.rb +1 -1
- data/spec/unit/brightbox/firewall_policy/find_spec.rb +2 -2
- data/spec/unit/brightbox/firewall_rule/create_spec.rb +1 -1
- data/spec/unit/brightbox/firewall_rule/destroy_spec.rb +1 -1
- data/spec/unit/brightbox/firewall_rule/find_spec.rb +1 -1
- data/spec/unit/brightbox/firewall_rule/from_policy_spec.rb +1 -1
- data/spec/unit/brightbox/server/destroy_spec.rb +1 -1
- data/spec/unit/brightbox/server/find_or_call_spec.rb +1 -1
- data/spec/unit/brightbox/server/find_spec.rb +1 -1
- data/spec/unit/brightbox/server/shutdown_spec.rb +1 -1
- data/spec/unit/brightbox/server/start_spec.rb +1 -1
- data/spec/unit/brightbox/server/stop_spec.rb +1 -1
- data/spec/unit/brightbox/server/update_spec.rb +1 -1
- data/spec/unit/brightbox/server_group/find_spec.rb +1 -1
- data/spec/unit/brightbox/user_collaboration/get_for_account_spec.rb +4 -4
- metadata +19 -5
@@ -13,7 +13,7 @@ describe "brightbox database-snapshots" do
|
|
13
13
|
cache_access_token(config, "f83da712e6299cda953513ec07f7a754f747d727")
|
14
14
|
end
|
15
15
|
|
16
|
-
context "when resource exists", :
|
16
|
+
context "when resource exists", vcr: true do
|
17
17
|
let(:argv) { %w(sql snapshots show dbi-12345) }
|
18
18
|
|
19
19
|
it "does not output to stderr" do
|
data/spec/spec_helper.rb
CHANGED
@@ -4,7 +4,6 @@ $LOAD_PATH.unshift LIB_DIR unless
|
|
4
4
|
$LOAD_PATH.include?(LIB_DIR) || $LOAD_PATH.include?(File.expand_path(LIB_DIR))
|
5
5
|
|
6
6
|
require "brightbox_cli"
|
7
|
-
require "support/common_helpers"
|
8
7
|
require "tmpdir"
|
9
8
|
|
10
9
|
Dir["./spec/support/**/*.rb"].sort.each { |f| require f }
|
@@ -28,12 +27,10 @@ RSpec.configure do |config|
|
|
28
27
|
config.include TokenHelpers
|
29
28
|
config.include PasswordPromptHelpers
|
30
29
|
|
31
|
-
config.filter_run_excluding :vcr if RUBY_VERSION <= "1.8.7"
|
32
|
-
|
33
30
|
# For each test, point to the testing endpoint to make it safer and easier to
|
34
31
|
# record from dev endpoints. Devs can DNS api.brightbox.dev to their dev service
|
35
32
|
config.before do
|
36
|
-
stub_const("Brightbox::DEFAULT_API_ENDPOINT", "http://api.brightbox.dev")
|
33
|
+
stub_const("Brightbox::DEFAULT_API_ENDPOINT", ENV["BRIGHTBOX_API_URL"] || "http://api.brightbox.dev")
|
37
34
|
end
|
38
35
|
|
39
36
|
# For each test, isolate the testing users $HOME so that we control the config
|
data/spec/support/vcr.rb
CHANGED
@@ -1,9 +1,5 @@
|
|
1
1
|
require "vcr"
|
2
2
|
|
3
|
-
RSpec.configure do |config|
|
4
|
-
config.treat_symbols_as_metadata_keys_with_true_values = true
|
5
|
-
end
|
6
|
-
|
7
3
|
VCR.configure do |vcr|
|
8
4
|
vcr.cassette_library_dir = File.join(File.dirname(__FILE__), "../cassettes")
|
9
5
|
vcr.allow_http_connections_when_no_cassette = false
|
@@ -8,7 +8,7 @@ describe Brightbox::Account do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
describe ".all" do
|
11
|
-
context "when connected using an application", :
|
11
|
+
context "when connected using an application", vcr: true do
|
12
12
|
let(:contents) { USER_APP_CONFIG_CONTENTS }
|
13
13
|
|
14
14
|
it "returns a collection of Accounts" do
|
@@ -26,7 +26,7 @@ describe Brightbox::Account do
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
context "when connected using an client", :
|
29
|
+
context "when connected using an client", vcr: true do
|
30
30
|
let(:contents) { API_CLIENT_CONFIG_CONTENTS }
|
31
31
|
|
32
32
|
it "returns a collection of Accounts" do
|
@@ -11,7 +11,7 @@ describe Brightbox::Account do
|
|
11
11
|
Brightbox::Api.configuration = USER_APP_CONFIG
|
12
12
|
end
|
13
13
|
|
14
|
-
context "and the account is accessible", :
|
14
|
+
context "and the account is accessible", vcr: true do
|
15
15
|
before do
|
16
16
|
@account_id = "acc-12345"
|
17
17
|
@account = Brightbox::Account.get(@account_id)
|
@@ -27,19 +27,19 @@ describe Brightbox::Account do
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
context "and the account is unknown", :
|
30
|
+
context "and the account is unknown", vcr: true do
|
31
31
|
it "returns nil" do
|
32
32
|
expect(Brightbox::Account.get("acc-xxxxx")).to be_nil
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
context "when connected using an client", :
|
37
|
+
context "when connected using an client", vcr: true do
|
38
38
|
before do
|
39
39
|
Brightbox::Api.configuration = API_CLIENT_CONFIG
|
40
40
|
end
|
41
41
|
|
42
|
-
context "and the account is accessible", :
|
42
|
+
context "and the account is accessible", vcr: true do
|
43
43
|
before do
|
44
44
|
@account_id = "acc-12345"
|
45
45
|
@account = Brightbox::Account.get(@account_id)
|
@@ -55,7 +55,7 @@ describe Brightbox::Account do
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
context "and the account is unknown", :
|
58
|
+
context "and the account is unknown", vcr: true do
|
59
59
|
it "returns nil" do
|
60
60
|
expect(Brightbox::Account.get("acc-xxxxx")).to be_nil
|
61
61
|
end
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Brightbox::Api, ".conn" do
|
4
4
|
|
5
|
-
context "when account is not required", :
|
5
|
+
context "when account is not required", vcr: true do
|
6
6
|
it "returns a 'real' fog compute instance" do
|
7
7
|
expect(Brightbox::Api.conn).to be_instance_of(Fog::Compute::Brightbox::Real)
|
8
8
|
end
|
@@ -3,7 +3,7 @@ require "spec_helper"
|
|
3
3
|
describe Brightbox::BBConfig do
|
4
4
|
|
5
5
|
describe "#add_section" do
|
6
|
-
context "when first and only client", :
|
6
|
+
context "when first and only client", vcr: true do
|
7
7
|
let(:config) { Brightbox::BBConfig.new }
|
8
8
|
let(:client_alias) { "dev" }
|
9
9
|
let(:client_id) { "app-12345" }
|
@@ -34,7 +34,7 @@ describe Brightbox::BBConfig do
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
context "when client is not authenticated", :
|
37
|
+
context "when client is not authenticated", vcr: true do
|
38
38
|
let(:contents) do
|
39
39
|
<<-EOS
|
40
40
|
[cli-12345]
|
@@ -58,7 +58,7 @@ describe Brightbox::BBConfig do
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
context "when client may access one account", :
|
61
|
+
context "when client may access one account", vcr: true do
|
62
62
|
let(:contents) do
|
63
63
|
<<-EOS
|
64
64
|
[cli-12345]
|
@@ -75,7 +75,7 @@ describe Brightbox::BBConfig do
|
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
-
context "when the client may access multiple accounts", :
|
78
|
+
context "when the client may access multiple accounts", vcr: true do
|
79
79
|
let(:contents) do
|
80
80
|
<<-EOS
|
81
81
|
[app-12345]
|
@@ -12,7 +12,7 @@ describe Brightbox::BBConfig do
|
|
12
12
|
let(:cli_secret) { "qy6xxnvy4o0tgv5" }
|
13
13
|
|
14
14
|
describe "#renew_tokens" do
|
15
|
-
context "when using a user app with no tokens", :
|
15
|
+
context "when using a user app with no tokens", vcr: true do
|
16
16
|
before do
|
17
17
|
contents = <<-EOS
|
18
18
|
[app-12345]
|
@@ -43,7 +43,7 @@ describe Brightbox::BBConfig do
|
|
43
43
|
|
44
44
|
end
|
45
45
|
|
46
|
-
context "when using a user app with a cached refresh token", :
|
46
|
+
context "when using a user app with a cached refresh token", vcr: true do
|
47
47
|
before do
|
48
48
|
@config = config_from_contents(USER_APP_CONFIG_CONTENTS)
|
49
49
|
|
@@ -72,7 +72,7 @@ describe Brightbox::BBConfig do
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
context "when using a user app with an expired refresh token", :
|
75
|
+
context "when using a user app with an expired refresh token", vcr: true do
|
76
76
|
before do
|
77
77
|
@config = config_from_contents(USER_APP_CONFIG_CONTENTS)
|
78
78
|
|
@@ -100,7 +100,7 @@ describe Brightbox::BBConfig do
|
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
-
context "when using an API client with no tokens", :
|
103
|
+
context "when using an API client with no tokens", vcr: true do
|
104
104
|
before do
|
105
105
|
@new_access_token = random_token
|
106
106
|
@config = config_from_contents(API_CLIENT_CONFIG_CONTENTS)
|
@@ -116,7 +116,7 @@ describe Brightbox::BBConfig do
|
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
119
|
-
context "when config in use is not the default", :
|
119
|
+
context "when config in use is not the default", vcr: true do
|
120
120
|
before do
|
121
121
|
contents = <<-EOS
|
122
122
|
[core]
|
@@ -8,7 +8,7 @@ describe Brightbox::CloudIP do
|
|
8
8
|
@cip = Brightbox::CloudIP.create
|
9
9
|
end
|
10
10
|
|
11
|
-
it "returns a suitable", :
|
11
|
+
it "returns a suitable", vcr: true do
|
12
12
|
ips = Brightbox::CloudIP.find(:all)
|
13
13
|
output = FauxIO.new do
|
14
14
|
Brightbox.render_table(ips.sort, :vertical => true)
|
@@ -92,7 +92,7 @@ describe Brightbox::Config::ApiClient do
|
|
92
92
|
end
|
93
93
|
|
94
94
|
it "raises error" do
|
95
|
-
expect { section.to_fog }.to raise_error
|
95
|
+
expect { section.to_fog }.to raise_error(Brightbox::BBConfigError, "api_url option missing from config in section cli-12345")
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
@@ -106,7 +106,7 @@ describe Brightbox::Config::ApiClient do
|
|
106
106
|
end
|
107
107
|
|
108
108
|
it "raises error" do
|
109
|
-
expect { section.to_fog }.to raise_error
|
109
|
+
expect { section.to_fog }.to raise_error(Brightbox::BBConfigError, "client_id option missing from config in section cli-12345")
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
@@ -120,7 +120,7 @@ describe Brightbox::Config::ApiClient do
|
|
120
120
|
end
|
121
121
|
|
122
122
|
it "raises error" do
|
123
|
-
expect { section.to_fog }.to raise_error
|
123
|
+
expect { section.to_fog }.to raise_error(Brightbox::BBConfigError, "secret option missing from config in section cli-12345")
|
124
124
|
end
|
125
125
|
end
|
126
126
|
end
|
@@ -96,7 +96,7 @@ describe Brightbox::Config::UserApplication do
|
|
96
96
|
end
|
97
97
|
|
98
98
|
it "raises error" do
|
99
|
-
expect { section.to_fog }.to raise_error
|
99
|
+
expect { section.to_fog }.to raise_error(Brightbox::BBConfigError, "api_url option missing from config in section app-12345")
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
@@ -111,7 +111,7 @@ describe Brightbox::Config::UserApplication do
|
|
111
111
|
end
|
112
112
|
|
113
113
|
it "raises error" do
|
114
|
-
expect { section.to_fog }.to raise_error
|
114
|
+
expect { section.to_fog }.to raise_error(Brightbox::BBConfigError, "client_id option missing from config in section app-12345")
|
115
115
|
end
|
116
116
|
end
|
117
117
|
|
@@ -126,7 +126,7 @@ describe Brightbox::Config::UserApplication do
|
|
126
126
|
end
|
127
127
|
|
128
128
|
it "raises error" do
|
129
|
-
expect { section.to_fog }.to raise_error
|
129
|
+
expect { section.to_fog }.to raise_error(Brightbox::BBConfigError, "secret option missing from config in section app-12345")
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
@@ -141,7 +141,7 @@ describe Brightbox::Config::UserApplication do
|
|
141
141
|
end
|
142
142
|
|
143
143
|
it "raises error" do
|
144
|
-
expect { section.to_fog }.to raise_error
|
144
|
+
expect { section.to_fog }.to raise_error(Brightbox::BBConfigError, "username option missing from config in section app-12345")
|
145
145
|
end
|
146
146
|
end
|
147
147
|
end
|
@@ -11,7 +11,7 @@ describe Brightbox::FirewallPolicy do
|
|
11
11
|
@policy = Brightbox::FirewallPolicy.create(options)
|
12
12
|
end
|
13
13
|
|
14
|
-
it "should show firewall policy", :
|
14
|
+
it "should show firewall policy", vcr: true do
|
15
15
|
output = FauxIO.new do
|
16
16
|
firewall_policy = Brightbox::FirewallPolicy.find_or_call([@policy.id])
|
17
17
|
Brightbox.render_table(firewall_policy, :vertical => true)
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Brightbox::FirewallPolicy do
|
4
4
|
|
5
|
-
describe "#find(:all)", :
|
5
|
+
describe "#find(:all)", vcr: true do
|
6
6
|
|
7
7
|
context "when a policy exists" do
|
8
8
|
before do
|
@@ -10,7 +10,7 @@ describe Brightbox::FirewallPolicy do
|
|
10
10
|
@policy = Brightbox::FirewallPolicy.create(options)
|
11
11
|
end
|
12
12
|
|
13
|
-
it "should list firewall policy", :
|
13
|
+
it "should list firewall policy", vcr: true do
|
14
14
|
output = FauxIO.new do
|
15
15
|
firewall_policies = Brightbox::FirewallPolicy.find(:all)
|
16
16
|
Brightbox.render_table(firewall_policies, :vertical => true)
|
@@ -17,7 +17,7 @@ describe Brightbox::FirewallRule do
|
|
17
17
|
}
|
18
18
|
end
|
19
19
|
|
20
|
-
it "creates the rule successfully", :
|
20
|
+
it "creates the rule successfully", vcr: true do
|
21
21
|
@rule = Brightbox::FirewallRule.create(@rule_options)
|
22
22
|
output = FauxIO.new do
|
23
23
|
Brightbox.render_table([@rule], :vertical => true)
|
@@ -4,7 +4,7 @@ describe Brightbox::Server do
|
|
4
4
|
include ServerHelpers
|
5
5
|
|
6
6
|
describe "#destroy" do
|
7
|
-
context "when server exists", :
|
7
|
+
context "when server exists", vcr: true do
|
8
8
|
it "should work" do
|
9
9
|
# FIXME: Spec never actually calls destroy, just checks output of creation!!
|
10
10
|
|
@@ -3,7 +3,7 @@ require "spec_helper"
|
|
3
3
|
describe Brightbox::Server do
|
4
4
|
include ServerHelpers
|
5
5
|
|
6
|
-
describe "#shutdown", :
|
6
|
+
describe "#shutdown", vcr: true do
|
7
7
|
it "should work" do
|
8
8
|
type = Brightbox::Type.find_by_handle "nano"
|
9
9
|
options = server_params("rspec_server_shutdown", type)
|
@@ -8,7 +8,7 @@ describe Brightbox::UserCollaboration do
|
|
8
8
|
expect(Brightbox::UserCollaboration.conn).to receive(:user_collaborations).and_return(faux_api_response)
|
9
9
|
end
|
10
10
|
|
11
|
-
context "when collaboration exists but is complete", :
|
11
|
+
context "when collaboration exists but is complete", vcr: true do
|
12
12
|
it "does not return the complete collaboration" do
|
13
13
|
@account = "acc-aaaaa"
|
14
14
|
@collaboration = Brightbox::UserCollaboration.get_for_account(@account)
|
@@ -16,7 +16,7 @@ describe Brightbox::UserCollaboration do
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
context "when a collaboration exists for user on account", :
|
19
|
+
context "when a collaboration exists for user on account", vcr: true do
|
20
20
|
before do
|
21
21
|
@account = "acc-aaaaa"
|
22
22
|
@collaboration = Brightbox::UserCollaboration.get_for_account(@account)
|
@@ -31,7 +31,7 @@ describe Brightbox::UserCollaboration do
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
context "when multiple collaborations exist", :
|
34
|
+
context "when multiple collaborations exist", vcr: true do
|
35
35
|
before do
|
36
36
|
@account = "acc-aaaaa"
|
37
37
|
@collaboration = Brightbox::UserCollaboration.get_for_account(@account)
|
@@ -42,7 +42,7 @@ describe Brightbox::UserCollaboration do
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
context "when no collaboration exists", :
|
45
|
+
context "when no collaboration exists", vcr: true do
|
46
46
|
it "returns nil" do
|
47
47
|
@account = "acc-zzzzz"
|
48
48
|
@collaboration = Brightbox::UserCollaboration.get_for_account(@account)
|