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.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/Gemfile.lock +7 -6
  4. data/brightbox-cli.gemspec +2 -1
  5. data/lib/brightbox-cli/config/clients.rb +1 -1
  6. data/lib/brightbox-cli/gli_global_hooks.rb +3 -1
  7. data/lib/brightbox-cli/images.rb +1 -1
  8. data/lib/brightbox-cli/version.rb +1 -1
  9. data/lib/brightbox_cli.rb +1 -1
  10. data/spec/cassettes/Brightbox_Account/_all/when_connected_using_an_application/returns_a_collection_of_Accounts.yml +3 -3
  11. data/spec/cassettes/Brightbox_Account/_all/when_connected_using_an_application/returns_resources_on_the_same_connection.yml +1 -1
  12. data/spec/cassettes/Brightbox_Account/_all/when_connected_using_an_client/returns_a_collection_of_Accounts.yml +2 -2
  13. data/spec/cassettes/Brightbox_Account/_all/when_connected_using_an_client/returns_resources_on_the_same_connection.yml +1 -1
  14. data/spec/cassettes/Brightbox_BBConfig/_add_section/when_first_and_only_client/saves_changes_to_the_config_file.yml +1 -1
  15. data/spec/cassettes/Brightbox_BBConfig/_add_section/when_first_and_only_client/saves_the_default_account.yml +1 -1
  16. data/spec/cassettes/Brightbox_BBConfig/_add_section/when_first_and_only_client/saves_the_new_client_as_the_default.yml +1 -1
  17. data/spec/cassettes/Brightbox_BBConfig/_find_or_set_default_account/when_client_is_not_authenticated/does_not_raise_an_error.yml +5 -5
  18. data/spec/cassettes/Brightbox_BBConfig/_find_or_set_default_account/when_client_may_access_one_account/updates_the_setting.yml +5 -5
  19. data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_config_in_use_is_not_the_default/uses_correct_credentials.yml +1 -1
  20. data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_a_user_app_with_a_cached_refresh_token/caches_the_new_tokens.yml +1 -1
  21. data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_a_user_app_with_an_expired_refresh_token/caches_the_new_tokens.yml +2 -2
  22. data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_a_user_app_with_no_tokens/caches_the_new_tokens.yml +1 -1
  23. data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_a_user_app_with_no_tokens/prompts_user_to_retry_command.yml +1 -1
  24. data/spec/cassettes/Brightbox_BBConfig/_renew_tokens/when_using_an_API_client_with_no_tokens/caches_a_new_access_token.yml +1 -1
  25. data/spec/cassettes/Brightbox_CloudIP/_find_all_/when_a_Cloud_IP_exists/returns_a_suitable.yml +7 -7
  26. data/spec/cassettes/Brightbox_FirewallPolicy/_apply_to/should_apply_firewall_policy.yml +6 -6
  27. data/spec/cassettes/Brightbox_FirewallPolicy/_create/should_create_firewall_policy.yml +6 -6
  28. data/spec/cassettes/Brightbox_FirewallPolicy/_destroy/should_destroy_firewall_policy.yml +7 -7
  29. data/spec/cassettes/Brightbox_FirewallPolicy/_find_all_/when_a_policy_exists/should_list_firewall_policy.yml +6 -6
  30. data/spec/cassettes/Brightbox_FirewallPolicy/_find_or_call/when_a_policy_exists/should_show_firewall_policy.yml +5 -5
  31. data/spec/cassettes/Brightbox_FirewallRule/_create/when_policy_exists/creates_the_rule_successfully.yml +6 -6
  32. data/spec/cassettes/Brightbox_FirewallRule/_destroy/when_rule_exists/destroys_a_rule.yml +5 -5
  33. data/spec/cassettes/Brightbox_FirewallRule/_find/when_rule_exists/can_display_the_result.yml +6 -6
  34. data/spec/cassettes/Brightbox_FirewallRule/_from_policy/when_policy_exists_with_a_rule/lists_all_rules.yml +8 -8
  35. data/spec/cassettes/Brightbox_Server/_destroy/when_server_exists/should_work.yml +5 -5
  36. data/spec/cassettes/Brightbox_Server/_find_all_/when_a_server_exists/should_print_server_list.yml +7 -7
  37. data/spec/cassettes/Brightbox_Server/_show/when_server_exists/shows_detailed_attributes_of_a_server.yml +8 -8
  38. data/spec/cassettes/Brightbox_Server/_shutdown/should_work.yml +8 -8
  39. data/spec/cassettes/Brightbox_Server/_start/should_work.yml +11 -11
  40. data/spec/cassettes/Brightbox_Server/_stop/should_work.yml +8 -8
  41. data/spec/cassettes/Brightbox_Server/_update/when_passing_new_group_membership/should_update_with_group.yml +10 -10
  42. data/spec/cassettes/Brightbox_ServerGroup/_find_all_/when_a_group_exists/list_server_groups.yml +6 -6
  43. data/spec/cassettes/Firewall_policies/update/when_the_policy_does_not_exist/prints_error_to_STDERR.yml +1 -1
  44. data/spec/cassettes/brightbox_accounts/list/_when_access_token_expired_/does_not_report_invalid_token_errors.yml +7 -7
  45. data/spec/cassettes/brightbox_accounts/list/_when_both_tokens_expired_/does_not_report_invalid_token_errors.yml +7 -7
  46. data/spec/cassettes/brightbox_accounts/list/_when_invalid_tokens_/does_not_report_invalid_token_errors.yml +7 -7
  47. data/spec/cassettes/brightbox_accounts/list/_when_no_tokens_/does_not_report_invalid_token_errors.yml +6 -6
  48. data/spec/cassettes/brightbox_accounts/list/_when_no_tokens_/reports_they_were_updated.yml +5 -5
  49. data/spec/cassettes/brightbox_accounts/list/_when_no_tokens_and_password_incorrect_/does_not_report_invalid_token_errors.yml +5 -5
  50. data/spec/cassettes/brightbox_accounts/list/_when_no_tokens_and_password_incorrect_/reports_unable_to_authenticate.yml +4 -4
  51. data/spec/cassettes/brightbox_accounts/list/does_not_error.yml +2 -2
  52. data/spec/cassettes/brightbox_cloudips/map/when_destination_is_a_server_ID/passes_the_interface_identifier_to_the_API.yml +6 -6
  53. data/spec/cassettes/brightbox_cloudips/map/when_destination_is_another_value/passes_the_identifier_to_the_API.yml +3 -3
  54. data/spec/cassettes/brightbox_config/client_add/when_adding_a_new_client/does_not_error.yml +4 -4
  55. data/spec/cassettes/brightbox_config/client_add/when_adding_a_new_client/sets_up_the_config.yml +4 -4
  56. data/spec/cassettes/brightbox_config/client_add/when_new_client_is_first_and_only_client/does_not_change_the_default_client.yml +4 -4
  57. data/spec/cassettes/brightbox_config/client_add/when_new_client_is_first_and_only_client/does_not_error.yml +4 -4
  58. data/spec/cassettes/brightbox_config/client_add/when_new_client_is_first_and_only_client/sets_this_as_the_default_client.yml +4 -4
  59. data/spec/cassettes/brightbox_config/client_add/when_new_client_is_first_and_only_client/sets_up_the_config.yml +4 -4
  60. data/spec/cassettes/brightbox_config/user_add/when_NO_config_file_on_disk/sets_up_the_config.yml +3 -3
  61. data/spec/cassettes/brightbox_config/user_add/when_a_default_client_is_already_set/does_not_change_the_default_client.yml +1 -1
  62. data/spec/cassettes/brightbox_config/user_add/when_application_details_in_config/does_not_error.yml +1 -1
  63. data/spec/cassettes/brightbox_config/user_add/when_application_details_in_config/sets_up_the_config.yml +1 -1
  64. data/spec/cassettes/brightbox_config/user_add/when_application_has_access_only_one_active_account/display_an_warning_about_preselected_default.yml +1 -1
  65. data/spec/cassettes/brightbox_config/user_add/when_application_has_access_only_one_active_account/does_not_error.yml +1 -1
  66. 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
  67. data/spec/cassettes/brightbox_config/user_add/when_application_has_access_only_one_active_account/sets_up_the_config.yml +1 -1
  68. data/spec/cassettes/brightbox_config/user_add/when_application_has_access_to_multiple_accounts/display_an_warning_about_preselected_default.yml +1 -1
  69. data/spec/cassettes/brightbox_config/user_add/when_application_has_access_to_multiple_accounts/does_not_error.yml +1 -1
  70. data/spec/cassettes/brightbox_config/user_add/when_application_has_access_to_multiple_accounts/sets_up_the_config.yml +1 -1
  71. data/spec/cassettes/brightbox_config/user_add/when_new_client_is_first_and_only_client/does_not_error.yml +1 -1
  72. 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
  73. data/spec/cassettes/brightbox_config/user_add/when_new_client_is_first_and_only_client/requests_access_tokens.yml +1 -1
  74. data/spec/cassettes/brightbox_config/user_add/when_new_client_is_first_and_only_client/sets_this_as_the_default_client.yml +1 -1
  75. data/spec/cassettes/brightbox_config/user_add/when_new_client_is_first_and_only_client/sets_up_the_config.yml +3 -3
  76. data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments/does_not_error.yml +1 -1
  77. data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments/does_not_prompt_to_rerun_the_command.yml +1 -1
  78. data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments/requests_access_tokens.yml +1 -1
  79. data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments/sets_up_the_config.yml +2 -2
  80. data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments_and_api_url/does_not_error.yml +1 -1
  81. data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments_and_api_url/requests_access_tokens.yml +1 -1
  82. data/spec/cassettes/brightbox_config/user_add/when_passing_in_required_arguments_and_api_url/sets_up_the_config.yml +1 -1
  83. data/spec/cassettes/brightbox_database-servers/create/--allow-access_10_0_0_0/correctly_sends_API_parameters.yml +1 -1
  84. data/spec/cassettes/brightbox_database-servers/create/--allow-access_srv-12345_grp-12345/correctly_sends_API_parameters.yml +1 -1
  85. data/spec/cassettes/brightbox_database-servers/create/--engine_mysql/correctly_sends_API_parameters.yml +1 -1
  86. data/spec/cassettes/brightbox_database-servers/create/--engine_mysql_--engine-version_5_6/correctly_sends_API_parameters.yml +1 -1
  87. data/spec/cassettes/brightbox_database-servers/create/without_arguments/reports_the_new_admin_password.yml +1 -1
  88. data/spec/cassettes/brightbox_database-servers/create/without_arguments/reports_the_new_admin_username.yml +1 -1
  89. data/spec/cassettes/brightbox_database-servers/snapshot/when_database_server_active/correctly_sends_API_parameters.yml +2 -2
  90. data/spec/cassettes/brightbox_database-servers/snapshot/when_database_server_can_not_be_snapshotted/reports_an_error_to_the_user.yml +1 -1
  91. data/spec/cassettes/brightbox_database-snapshots/list/when_resources_are_available/does_not_output_to_stderr.yml +1 -1
  92. data/spec/cassettes/brightbox_database-snapshots/list/when_resources_are_available/outputs_table_details_to_stdout.yml +1 -1
  93. data/spec/cassettes/brightbox_database-snapshots/show/when_resource_exists/does_not_output_to_stderr.yml +1 -1
  94. data/spec/commands/accounts/list_spec.rb +6 -6
  95. data/spec/commands/cloudips/map_spec.rb +2 -2
  96. data/spec/commands/config/client_add_spec.rb +3 -3
  97. data/spec/commands/config/user_add_spec.rb +8 -8
  98. data/spec/commands/firewall_policies/update_spec.rb +5 -5
  99. data/spec/commands/sql/instances/create_spec.rb +5 -5
  100. data/spec/commands/sql/instances/snapshot_spec.rb +2 -2
  101. data/spec/commands/sql/snapshots/list_spec.rb +1 -1
  102. data/spec/commands/sql/snapshots/show_spec.rb +1 -1
  103. data/spec/spec_helper.rb +1 -4
  104. data/spec/support/vcr.rb +0 -4
  105. data/spec/unit/brightbox/account/all_spec.rb +2 -2
  106. data/spec/unit/brightbox/account/get_spec.rb +5 -5
  107. data/spec/unit/brightbox/api/conn_spec.rb +1 -1
  108. data/spec/unit/brightbox/bb_config/add_section_spec.rb +1 -1
  109. data/spec/unit/brightbox/bb_config/find_or_set_default_account_spec.rb +3 -3
  110. data/spec/unit/brightbox/bb_config/renew_tokens_spec.rb +5 -5
  111. data/spec/unit/brightbox/cloud_ip/find_spec.rb +1 -1
  112. data/spec/unit/brightbox/config/api_client/to_fog_spec.rb +3 -3
  113. data/spec/unit/brightbox/config/user_application/to_fog_spec.rb +4 -4
  114. data/spec/unit/brightbox/firewall_policy/apply_to_spec.rb +1 -1
  115. data/spec/unit/brightbox/firewall_policy/create_spec.rb +1 -1
  116. data/spec/unit/brightbox/firewall_policy/destroy_spec.rb +1 -1
  117. data/spec/unit/brightbox/firewall_policy/find_or_call_spec.rb +1 -1
  118. data/spec/unit/brightbox/firewall_policy/find_spec.rb +2 -2
  119. data/spec/unit/brightbox/firewall_rule/create_spec.rb +1 -1
  120. data/spec/unit/brightbox/firewall_rule/destroy_spec.rb +1 -1
  121. data/spec/unit/brightbox/firewall_rule/find_spec.rb +1 -1
  122. data/spec/unit/brightbox/firewall_rule/from_policy_spec.rb +1 -1
  123. data/spec/unit/brightbox/server/destroy_spec.rb +1 -1
  124. data/spec/unit/brightbox/server/find_or_call_spec.rb +1 -1
  125. data/spec/unit/brightbox/server/find_spec.rb +1 -1
  126. data/spec/unit/brightbox/server/shutdown_spec.rb +1 -1
  127. data/spec/unit/brightbox/server/start_spec.rb +1 -1
  128. data/spec/unit/brightbox/server/stop_spec.rb +1 -1
  129. data/spec/unit/brightbox/server/update_spec.rb +1 -1
  130. data/spec/unit/brightbox/server_group/find_spec.rb +1 -1
  131. data/spec/unit/brightbox/user_collaboration/get_for_account_spec.rb +4 -4
  132. 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", :vcr do
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
@@ -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
@@ -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", :vcr do
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", :vcr do
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", :vcr do
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", :vcr do
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", :vcr do
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", :vcr do
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", :vcr do
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", :vcr do
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", :vcr do
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", :vcr do
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", :vcr do
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", :vcr do
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", :vcr do
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", :vcr do
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", :vcr do
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", :vcr do
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", :vcr do
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", :vcr do
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
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe Brightbox::FirewallPolicy do
4
4
 
5
- describe "#apply_to", :vcr do
5
+ describe "#apply_to", vcr: true do
6
6
 
7
7
  it "should apply firewall policy" do
8
8
  expect do
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe Brightbox::FirewallPolicy do
4
4
 
5
- describe "#create", :vcr do
5
+ describe "#create", vcr: true do
6
6
 
7
7
  it "should create firewall policy" do
8
8
  params = { :name => "rspec_tests" }
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe Brightbox::FirewallPolicy do
4
4
 
5
- describe "#destroy", :vcr do
5
+ describe "#destroy", vcr: true do
6
6
  it "should destroy firewall policy" do
7
7
  params = { :name => "rspec_tests" }
8
8
  @group = Brightbox::ServerGroup.create(params)
@@ -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", :vcr do
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)", :vcr do
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", :vcr do
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", :vcr do
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)
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe Brightbox::FirewallRule do
4
4
 
5
- describe "#destroy", :vcr do
5
+ describe "#destroy", vcr: true do
6
6
  context "when rule exists" do
7
7
  before do
8
8
  policy_options = {}
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe Brightbox::FirewallRule do
4
4
 
5
- describe "#find", :vcr do
5
+ describe "#find", vcr: true do
6
6
  context "when rule exists" do
7
7
  before do
8
8
  policy_options = {}
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe Brightbox::FirewallRule do
4
4
 
5
- describe ".from_policy", :vcr do
5
+ describe ".from_policy", vcr: true do
6
6
  context "when policy exists with a rule" do
7
7
  before do
8
8
  policy_options = {}
@@ -4,7 +4,7 @@ describe Brightbox::Server do
4
4
  include ServerHelpers
5
5
 
6
6
  describe "#destroy" do
7
- context "when server exists", :vcr do
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
 
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe Brightbox::Server do
4
4
 
5
- describe "#show", :vcr do
5
+ describe "#show", vcr: true do
6
6
  context "when server exists" do
7
7
  before do
8
8
  options = {
@@ -4,7 +4,7 @@ describe Brightbox::Server do
4
4
  let(:image_id) { "img-12345" }
5
5
 
6
6
  describe "#find(:all)" do
7
- context "when a server exists", :vcr do
7
+ context "when a server exists", vcr: true do
8
8
  before do
9
9
  options = {
10
10
  :image_id => image_id
@@ -3,7 +3,7 @@ require "spec_helper"
3
3
  describe Brightbox::Server do
4
4
  include ServerHelpers
5
5
 
6
- describe "#shutdown", :vcr do
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)
@@ -3,7 +3,7 @@ require "spec_helper"
3
3
  describe Brightbox::Server do
4
4
  include ServerHelpers
5
5
 
6
- describe "#start", :vcr do
6
+ describe "#start", 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_start", type)
@@ -3,7 +3,7 @@ require "spec_helper"
3
3
  describe Brightbox::Server do
4
4
  include ServerHelpers
5
5
 
6
- describe "#stop", :vcr do
6
+ describe "#stop", 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_stop", type)
@@ -4,7 +4,7 @@ describe Brightbox::Server do
4
4
  let(:image_id) { "img-12345" }
5
5
 
6
6
  describe "#update" do
7
- context "when passing new group membership", :vcr do
7
+ context "when passing new group membership", vcr: true do
8
8
  before do
9
9
  options = {
10
10
  :image_id => image_id
@@ -3,7 +3,7 @@ require "spec_helper"
3
3
  describe Brightbox::ServerGroup do
4
4
 
5
5
  describe "#find(:all)" do
6
- context "when a group exists", :vcr do
6
+ context "when a group exists", vcr: true do
7
7
  before do
8
8
  options = {
9
9
  :name => "Test group"
@@ -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", :vcr do
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", :vcr do
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", :vcr do
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", :vcr do
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)