brightbox-cli 1.2.2 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (245) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/Gemfile +0 -2
  4. data/Gemfile.lock +25 -23
  5. data/Rakefile +1 -1
  6. data/bin/_brightbox-bash-completer +327 -328
  7. data/bin/brightbox +2 -2
  8. data/bin/brightbox-accounts +2 -2
  9. data/bin/brightbox-cloudips +2 -2
  10. data/bin/brightbox-config +2 -2
  11. data/bin/brightbox-firewall-policies +2 -2
  12. data/bin/brightbox-firewall-rules +2 -2
  13. data/bin/brightbox-groups +2 -2
  14. data/bin/brightbox-images +2 -2
  15. data/bin/brightbox-lbs +2 -2
  16. data/bin/brightbox-servers +2 -2
  17. data/bin/brightbox-types +2 -2
  18. data/bin/brightbox-users +2 -2
  19. data/bin/brightbox-zones +2 -2
  20. data/brightbox-cli.gemspec +14 -15
  21. data/lib/brightbox-cli/api.rb +4 -6
  22. data/lib/brightbox-cli/collaboration.rb +1 -3
  23. data/lib/brightbox-cli/commands/accounts/accept-invite.rb +1 -1
  24. data/lib/brightbox-cli/commands/accounts/default.rb +1 -1
  25. data/lib/brightbox-cli/commands/accounts/list.rb +1 -1
  26. data/lib/brightbox-cli/commands/accounts/remove.rb +1 -1
  27. data/lib/brightbox-cli/commands/accounts/reset-ftp-password.rb +1 -1
  28. data/lib/brightbox-cli/commands/accounts/show.rb +1 -1
  29. data/lib/brightbox-cli/commands/cloudips/create.rb +1 -1
  30. data/lib/brightbox-cli/commands/cloudips/destroy.rb +1 -1
  31. data/lib/brightbox-cli/commands/cloudips/list.rb +1 -1
  32. data/lib/brightbox-cli/commands/cloudips/show.rb +1 -1
  33. data/lib/brightbox-cli/commands/cloudips/unmap.rb +1 -1
  34. data/lib/brightbox-cli/commands/collaborations.rb +4 -4
  35. data/lib/brightbox-cli/commands/config/client-add.rb +1 -1
  36. data/lib/brightbox-cli/commands/config/client-default.rb +1 -1
  37. data/lib/brightbox-cli/commands/config/client-list.rb +1 -1
  38. data/lib/brightbox-cli/commands/config/client-remove.rb +1 -1
  39. data/lib/brightbox-cli/commands/config/user-add.rb +1 -1
  40. data/lib/brightbox-cli/commands/firewall/policies-destroy.rb +1 -1
  41. data/lib/brightbox-cli/commands/firewall/policies-list.rb +1 -1
  42. data/lib/brightbox-cli/commands/firewall/policies-show.rb +1 -1
  43. data/lib/brightbox-cli/commands/firewall/rules-destroy.rb +1 -1
  44. data/lib/brightbox-cli/commands/firewall/rules-list.rb +1 -1
  45. data/lib/brightbox-cli/commands/firewall/rules-show.rb +1 -1
  46. data/lib/brightbox-cli/commands/groups/add-server.rb +1 -1
  47. data/lib/brightbox-cli/commands/groups/create.rb +1 -1
  48. data/lib/brightbox-cli/commands/groups/destroy.rb +1 -1
  49. data/lib/brightbox-cli/commands/groups/list.rb +1 -1
  50. data/lib/brightbox-cli/commands/groups/show.rb +1 -1
  51. data/lib/brightbox-cli/commands/images/destroy.rb +1 -1
  52. data/lib/brightbox-cli/commands/images/locking.rb +37 -0
  53. data/lib/brightbox-cli/commands/images/register.rb +1 -1
  54. data/lib/brightbox-cli/commands/images/show.rb +18 -4
  55. data/lib/brightbox-cli/commands/lbs/add-nodes.rb +1 -1
  56. data/lib/brightbox-cli/commands/lbs/destroy.rb +1 -1
  57. data/lib/brightbox-cli/commands/lbs/list.rb +1 -1
  58. data/lib/brightbox-cli/commands/lbs/locking.rb +37 -0
  59. data/lib/brightbox-cli/commands/lbs/remove-nodes.rb +1 -1
  60. data/lib/brightbox-cli/commands/lbs/show.rb +3 -2
  61. data/lib/brightbox-cli/commands/servers/activate-console.rb +1 -1
  62. data/lib/brightbox-cli/commands/servers/destroy.rb +1 -1
  63. data/lib/brightbox-cli/commands/servers/locking.rb +37 -0
  64. data/lib/brightbox-cli/commands/servers/reboot.rb +20 -0
  65. data/lib/brightbox-cli/commands/servers/reset.rb +20 -0
  66. data/lib/brightbox-cli/commands/servers/show.rb +1 -1
  67. data/lib/brightbox-cli/commands/servers/shutdown.rb +1 -1
  68. data/lib/brightbox-cli/commands/servers/snapshot.rb +1 -1
  69. data/lib/brightbox-cli/commands/servers/start.rb +1 -1
  70. data/lib/brightbox-cli/commands/servers/stop.rb +1 -1
  71. data/lib/brightbox-cli/commands/sql/instances_create.rb +1 -1
  72. data/lib/brightbox-cli/commands/sql/instances_destroy.rb +1 -1
  73. data/lib/brightbox-cli/commands/sql/instances_list.rb +1 -1
  74. data/lib/brightbox-cli/commands/sql/instances_locking.rb +39 -0
  75. data/lib/brightbox-cli/commands/sql/instances_reset_password.rb +1 -1
  76. data/lib/brightbox-cli/commands/sql/instances_show.rb +1 -1
  77. data/lib/brightbox-cli/commands/sql/instances_snapshot.rb +1 -1
  78. data/lib/brightbox-cli/commands/sql/snapshots_destroy.rb +1 -1
  79. data/lib/brightbox-cli/commands/sql/snapshots_list.rb +1 -1
  80. data/lib/brightbox-cli/commands/sql/snapshots_locking.rb +39 -0
  81. data/lib/brightbox-cli/commands/sql/snapshots_show.rb +9 -2
  82. data/lib/brightbox-cli/commands/sql/types.rb +2 -2
  83. data/lib/brightbox-cli/commands/types.rb +2 -2
  84. data/lib/brightbox-cli/commands/user-collaborations.rb +2 -2
  85. data/lib/brightbox-cli/commands/users/list.rb +1 -1
  86. data/lib/brightbox-cli/commands/users/show.rb +1 -1
  87. data/lib/brightbox-cli/commands/zones.rb +1 -1
  88. data/lib/brightbox-cli/config/accounts.rb +1 -1
  89. data/lib/brightbox-cli/config/api_client.rb +3 -3
  90. data/lib/brightbox-cli/config/authentication_tokens.rb +2 -2
  91. data/lib/brightbox-cli/config/cache.rb +1 -1
  92. data/lib/brightbox-cli/config/dirty.rb +1 -1
  93. data/lib/brightbox-cli/config/user_application.rb +3 -3
  94. data/lib/brightbox-cli/config.rb +2 -2
  95. data/lib/brightbox-cli/database_server.rb +2 -1
  96. data/lib/brightbox-cli/database_snapshot.rb +1 -0
  97. data/lib/brightbox-cli/detailed_server.rb +1 -0
  98. data/lib/brightbox-cli/gli_global_hooks.rb +2 -2
  99. data/lib/brightbox-cli/images.rb +2 -1
  100. data/lib/brightbox-cli/legacy/args_adjuster.rb +3 -3
  101. data/lib/brightbox-cli/load_balancers.rb +1 -0
  102. data/lib/brightbox-cli/servers.rb +2 -1
  103. data/lib/brightbox-cli/user_collaboration.rb +1 -1
  104. data/lib/brightbox-cli/version.rb +1 -1
  105. data/lib/brightbox_cli.rb +3 -3
  106. data/locales/en.yml +24 -0
  107. data/spec/commands/accounts/default_spec.rb +2 -2
  108. data/spec/commands/accounts/list_spec.rb +7 -7
  109. data/spec/commands/accounts/reset_ftp_password_spec.rb +2 -2
  110. data/spec/commands/accounts/show_spec.rb +2 -2
  111. data/spec/commands/cloudips/create_spec.rb +2 -2
  112. data/spec/commands/cloudips/destroy_spec.rb +2 -2
  113. data/spec/commands/cloudips/list_spec.rb +2 -2
  114. data/spec/commands/cloudips/map_spec.rb +3 -3
  115. data/spec/commands/cloudips/show_spec.rb +2 -2
  116. data/spec/commands/cloudips/unmap_spec.rb +2 -2
  117. data/spec/commands/cloudips/update_spec.rb +2 -2
  118. data/spec/commands/config/client_add_spec.rb +2 -2
  119. data/spec/commands/config/client_default_spec.rb +2 -2
  120. data/spec/commands/config/client_list_spec.rb +2 -2
  121. data/spec/commands/config/client_remove_spec.rb +2 -2
  122. data/spec/commands/config/user_add_spec.rb +3 -6
  123. data/spec/commands/firewall_policies/update_spec.rb +7 -7
  124. data/spec/commands/groups/add_server_spec.rb +2 -2
  125. data/spec/commands/groups/create_spec.rb +2 -2
  126. data/spec/commands/groups/destroy_spec.rb +2 -2
  127. data/spec/commands/groups/list_spec.rb +2 -2
  128. data/spec/commands/groups/move_servers_spec.rb +2 -2
  129. data/spec/commands/groups/remove_servers_spec.rb +2 -2
  130. data/spec/commands/groups/show_spec.rb +2 -2
  131. data/spec/commands/groups/update_spec.rb +2 -2
  132. data/spec/commands/images/destroy_spec.rb +2 -2
  133. data/spec/commands/images/list_spec.rb +2 -2
  134. data/spec/commands/images/locking_spec.rb +73 -0
  135. data/spec/commands/images/register_spec.rb +2 -2
  136. data/spec/commands/images/show_spec.rb +2 -2
  137. data/spec/commands/images/update_spec.rb +2 -2
  138. data/spec/commands/lbs/add_nodes_spec.rb +2 -2
  139. data/spec/commands/lbs/create_spec.rb +2 -2
  140. data/spec/commands/lbs/destroy_spec.rb +2 -2
  141. data/spec/commands/lbs/list_spec.rb +2 -2
  142. data/spec/commands/lbs/locking_spec.rb +73 -0
  143. data/spec/commands/lbs/remove_nodes_spec.rb +2 -2
  144. data/spec/commands/lbs/show_spec.rb +2 -2
  145. data/spec/commands/lbs/update_spec.rb +2 -2
  146. data/spec/commands/policies/apply_spec.rb +2 -2
  147. data/spec/commands/policies/create_spec.rb +2 -2
  148. data/spec/commands/policies/destroy_spec.rb +2 -2
  149. data/spec/commands/policies/list_spec.rb +2 -2
  150. data/spec/commands/policies/remove_spec.rb +2 -2
  151. data/spec/commands/policies/show_spec.rb +2 -2
  152. data/spec/commands/policies/update_spec.rb +2 -2
  153. data/spec/commands/rules/create_spec.rb +2 -2
  154. data/spec/commands/rules/destroy_spec.rb +2 -2
  155. data/spec/commands/rules/list_spec.rb +2 -2
  156. data/spec/commands/rules/show_spec.rb +2 -2
  157. data/spec/commands/rules/update_spec.rb +2 -2
  158. data/spec/commands/servers/activate_console_spec.rb +2 -2
  159. data/spec/commands/servers/create_spec.rb +2 -2
  160. data/spec/commands/servers/destroy_spec.rb +2 -2
  161. data/spec/commands/servers/list_spec.rb +2 -2
  162. data/spec/commands/servers/locking_spec.rb +73 -0
  163. data/spec/commands/servers/reboot_spec.rb +55 -0
  164. data/spec/commands/servers/reset_spec.rb +55 -0
  165. data/spec/commands/servers/show_spec.rb +2 -2
  166. data/spec/commands/servers/shutdown_spec.rb +2 -2
  167. data/spec/commands/servers/snapshot_spec.rb +2 -2
  168. data/spec/commands/servers/start_spec.rb +2 -2
  169. data/spec/commands/servers/stop_spec.rb +2 -2
  170. data/spec/commands/servers/update_spec.rb +2 -2
  171. data/spec/commands/sql/instances/create_spec.rb +4 -4
  172. data/spec/commands/sql/instances/locking_spec.rb +73 -0
  173. data/spec/commands/sql/instances/snapshot_spec.rb +2 -2
  174. data/spec/commands/sql/snapshots/list_spec.rb +1 -1
  175. data/spec/commands/sql/snapshots/locking_spec.rb +73 -0
  176. data/spec/commands/sql/snapshots/show_spec.rb +1 -1
  177. data/spec/commands/sql/types/list_spec.rb +1 -1
  178. data/spec/commands/types/list_spec.rb +2 -2
  179. data/spec/commands/users/list_spec.rb +2 -2
  180. data/spec/commands/users/show_spec.rb +2 -2
  181. data/spec/commands/users/update_spec.rb +2 -2
  182. data/spec/commands/zones/list_spec.rb +2 -2
  183. data/spec/spec_helper.rb +8 -9
  184. data/spec/support/common_helpers.rb +10 -10
  185. data/spec/support/config_helpers.rb +0 -1
  186. data/spec/support/faux_io.rb +10 -14
  187. data/spec/support/password_prompt_helpers.rb +1 -2
  188. data/spec/support/server_helper.rb +1 -1
  189. data/spec/support/shared/api_resource_examples.rb +8 -8
  190. data/spec/support/shared/collaborating_accounts_context.rb +2 -2
  191. data/spec/support/shared/config_section_types.rb +2 -2
  192. data/spec/support/tmp_config.rb +4 -8
  193. data/spec/support/token_helpers.rb +1 -1
  194. data/spec/support/vcr.rb +1 -1
  195. data/spec/unit/brightbox/account/get_spec.rb +1 -1
  196. data/spec/unit/brightbox/account_spec.rb +3 -3
  197. data/spec/unit/brightbox/api/find_spec.rb +6 -6
  198. data/spec/unit/brightbox/api/require_account_spec.rb +1 -1
  199. data/spec/unit/brightbox/bb_config/account_spec.rb +3 -3
  200. data/spec/unit/brightbox/bb_config/clear_default_client_spec.rb +8 -8
  201. data/spec/unit/brightbox/bb_config/client_has_alias_spec.rb +3 -3
  202. data/spec/unit/brightbox/bb_config/client_name_spec.rb +5 -5
  203. data/spec/unit/brightbox/bb_config/client_named_spec.rb +6 -6
  204. data/spec/unit/brightbox/bb_config/config_directory_exists_spec.rb +3 -3
  205. data/spec/unit/brightbox/bb_config/config_spec.rb +5 -5
  206. data/spec/unit/brightbox/bb_config/default_account_spec.rb +6 -6
  207. data/spec/unit/brightbox/bb_config/default_client_spec.rb +2 -2
  208. data/spec/unit/brightbox/bb_config/find_or_set_default_account_spec.rb +14 -14
  209. data/spec/unit/brightbox/bb_config/has_multiple_clients_spec.rb +2 -2
  210. data/spec/unit/brightbox/bb_config/renew_tokens_spec.rb +4 -5
  211. data/spec/unit/brightbox/bb_config/save_spec.rb +2 -2
  212. data/spec/unit/brightbox/bb_config/to_fog_spec.rb +2 -2
  213. data/spec/unit/brightbox/bb_config/using_client_spec.rb +10 -10
  214. data/spec/unit/brightbox/collaborating_account/resource_type_spec.rb +4 -4
  215. data/spec/unit/brightbox/collaborating_account_spec.rb +3 -3
  216. data/spec/unit/brightbox/config/api_client/to_fog_spec.rb +2 -2
  217. data/spec/unit/brightbox/config/api_client/valid_spec.rb +5 -5
  218. data/spec/unit/brightbox/config/section_name_deduplicator_spec.rb +1 -1
  219. data/spec/unit/brightbox/config/to_fog_spec.rb +3 -3
  220. data/spec/unit/brightbox/config/user_application/to_fog_spec.rb +2 -2
  221. data/spec/unit/brightbox/config/user_application/valid_spec.rb +6 -6
  222. data/spec/unit/brightbox/connection_manager/fetch_connection_spec.rb +17 -17
  223. data/spec/unit/brightbox/firewall_policy/apply_to_spec.rb +3 -3
  224. data/spec/unit/brightbox/firewall_policy/create_spec.rb +5 -5
  225. data/spec/unit/brightbox/firewall_policy/destroy_spec.rb +4 -4
  226. data/spec/unit/brightbox/firewall_policy/find_or_call_spec.rb +1 -1
  227. data/spec/unit/brightbox/firewall_policy/find_spec.rb +1 -1
  228. data/spec/unit/brightbox/firewall_rule/create_spec.rb +1 -1
  229. data/spec/unit/brightbox/firewall_rule/destroy_spec.rb +2 -2
  230. data/spec/unit/brightbox/firewall_rule/find_spec.rb +3 -3
  231. data/spec/unit/brightbox/firewall_rule/from_policy_spec.rb +2 -2
  232. data/spec/unit/brightbox/legacy/args_adjuster_spec.rb +12 -12
  233. data/spec/unit/brightbox/server/create_spec.rb +2 -2
  234. data/spec/unit/brightbox/server/destroy_spec.rb +3 -3
  235. data/spec/unit/brightbox/server/find_or_call_spec.rb +1 -1
  236. data/spec/unit/brightbox/server/shutdown_spec.rb +2 -4
  237. data/spec/unit/brightbox/server/start_spec.rb +4 -4
  238. data/spec/unit/brightbox/server/stop_spec.rb +2 -4
  239. data/spec/unit/brightbox/server/update_spec.rb +2 -2
  240. data/spec/unit/brightbox/server_group/find_spec.rb +1 -1
  241. data/spec/unit/brightbox/user_collaboration/get_for_account_spec.rb +4 -4
  242. data/spec/unit/brightbox/user_collaboration/remove_spec.rb +11 -11
  243. data/spec/unit/nilable_hash_spec.rb +6 -6
  244. data/spec/unit/tmp_config_spec.rb +1 -1
  245. metadata +67 -31
@@ -18,7 +18,7 @@ describe Brightbox::BBConfig do
18
18
  EOS
19
19
  end
20
20
  it "is true" do
21
- expect(config.has_multiple_clients?).to be_true
21
+ expect(config.has_multiple_clients?).to be true
22
22
  end
23
23
  end
24
24
 
@@ -33,7 +33,7 @@ describe Brightbox::BBConfig do
33
33
  EOS
34
34
  end
35
35
  it "is false" do
36
- expect(config.has_multiple_clients?).to be_false
36
+ expect(config.has_multiple_clients?).to be false
37
37
  end
38
38
  end
39
39
  end
@@ -33,7 +33,7 @@ describe Brightbox::BBConfig do
33
33
 
34
34
  it "caches the new tokens" do
35
35
  # Access token
36
- expect(File.exists?(@config.access_token_filename)).to be_true
36
+ expect(File.exist?(@config.access_token_filename)).to be true
37
37
 
38
38
  expect(cached_access_token(@config)).to eql(@new_access_token)
39
39
 
@@ -55,7 +55,6 @@ describe Brightbox::BBConfig do
55
55
  @new_access_token = "0d09cf23393aeb039b7abe6fd15339108095e927"
56
56
  @new_refresh_token = "53779449e94964eefb10daaa4807fd5f007b5211"
57
57
 
58
-
59
58
  # If we are prompting then the refresh token has failed
60
59
  expect(@config).to_not receive(:prompt_for_password)
61
60
  @output = FauxIO.new { @config.renew_tokens }
@@ -63,7 +62,7 @@ describe Brightbox::BBConfig do
63
62
 
64
63
  it "caches the new tokens" do
65
64
  # Access token
66
- expect(File.exists?(@config.access_token_filename)).to be_true
65
+ expect(File.exist?(@config.access_token_filename)).to be true
67
66
 
68
67
  # NOTE The cached to disk version is filtered by VCR when testing
69
68
  expect(cached_access_token(@config)).to eql(@new_access_token)
@@ -91,7 +90,7 @@ describe Brightbox::BBConfig do
91
90
 
92
91
  it "caches the new tokens" do
93
92
  # Access token
94
- expect(File.exists?(@config.access_token_filename)).to be_true
93
+ expect(File.exist?(@config.access_token_filename)).to be true
95
94
 
96
95
  # NOTE The cached to disk version is filtered by VCR when testing
97
96
  expect(cached_access_token(@config)).to eql(@new_access_token)
@@ -112,7 +111,7 @@ describe Brightbox::BBConfig do
112
111
  end
113
112
 
114
113
  it "caches a new access token" do
115
- expect(File.exists?(@config.access_token_filename)).to be_true
114
+ expect(File.exist?(@config.access_token_filename)).to be true
116
115
  expect(cached_access_token(@config)).to eql("5f3fd8fe25388fc9b801afc15a23d3991c68257d")
117
116
  end
118
117
  end
@@ -6,7 +6,7 @@ describe Brightbox::BBConfig do
6
6
  let(:config) { Brightbox::BBConfig.new }
7
7
 
8
8
  before do
9
- Ini.any_instance.should_not_receive(:write)
9
+ expect_any_instance_of(Ini).not_to receive(:write)
10
10
  expect(config).to_not be_dirty
11
11
  end
12
12
 
@@ -24,7 +24,7 @@ describe Brightbox::BBConfig do
24
24
  let(:config) { Brightbox::BBConfig.new }
25
25
 
26
26
  before do
27
- Ini.any_instance.should_receive(:write)
27
+ expect_any_instance_of(Ini).to receive(:write)
28
28
  config.dirty!
29
29
  end
30
30
 
@@ -10,9 +10,9 @@ describe Brightbox::BBConfig do
10
10
  let(:contents) { "" }
11
11
 
12
12
  it "raises an error" do
13
- expect {
13
+ expect do
14
14
  fog_config.to_fog
15
- }.to raise_error(Brightbox::BBConfigError)
15
+ end.to raise_error(Brightbox::BBConfigError)
16
16
  end
17
17
  end
18
18
 
@@ -29,9 +29,9 @@ describe Brightbox::BBConfig do
29
29
  end
30
30
 
31
31
  it "does not raise an error" do
32
- expect {
32
+ expect do
33
33
  Brightbox::BBConfig.new.using_application?
34
- }.to raise_error(Brightbox::NoSelectedClientError, error_message)
34
+ end.to raise_error(Brightbox::NoSelectedClientError, error_message)
35
35
  end
36
36
  end
37
37
 
@@ -40,7 +40,7 @@ describe Brightbox::BBConfig do
40
40
 
41
41
  it "returns true" do
42
42
  config.client_name = client_name
43
- expect(config.using_application?).to be_true
43
+ expect(config.using_application?).to be true
44
44
  end
45
45
  end
46
46
 
@@ -49,7 +49,7 @@ describe Brightbox::BBConfig do
49
49
 
50
50
  it "returns false" do
51
51
  config.client_name = client_name
52
- expect(config.using_application?).to be_false
52
+ expect(config.using_application?).to be false
53
53
  end
54
54
  end
55
55
 
@@ -58,7 +58,7 @@ describe Brightbox::BBConfig do
58
58
 
59
59
  it "returns true" do
60
60
  config.client_name = client_name
61
- expect(config.using_application?).to be_true
61
+ expect(config.using_application?).to be true
62
62
  end
63
63
  end
64
64
  end
@@ -70,9 +70,9 @@ describe Brightbox::BBConfig do
70
70
  end
71
71
 
72
72
  it "does not raise an error" do
73
- expect {
73
+ expect do
74
74
  Brightbox::BBConfig.new.using_api_client?
75
- }.to raise_error(Brightbox::NoSelectedClientError, error_message)
75
+ end.to raise_error(Brightbox::NoSelectedClientError, error_message)
76
76
  end
77
77
  end
78
78
 
@@ -81,7 +81,7 @@ describe Brightbox::BBConfig do
81
81
 
82
82
  it "returns false" do
83
83
  config.client_name = client_name
84
- expect(config.using_api_client?).to be_false
84
+ expect(config.using_api_client?).to be false
85
85
  end
86
86
  end
87
87
 
@@ -90,7 +90,7 @@ describe Brightbox::BBConfig do
90
90
 
91
91
  it "returns true" do
92
92
  config.client_name = client_name
93
- expect(config.using_api_client?).to be_true
93
+ expect(config.using_api_client?).to be true
94
94
  end
95
95
  end
96
96
 
@@ -99,7 +99,7 @@ describe Brightbox::BBConfig do
99
99
 
100
100
  it "returns false" do
101
101
  config.client_name = client_name
102
- expect(config.using_api_client?).to be_false
102
+ expect(config.using_api_client?).to be false
103
103
  end
104
104
  end
105
105
  end
@@ -28,7 +28,7 @@ describe Brightbox::CollaboratingAccount do
28
28
  let(:initial_model) { owned_account }
29
29
 
30
30
  it "returns true" do
31
- expect(account.account?).to be_true
31
+ expect(account.account?).to be true
32
32
  end
33
33
  end
34
34
 
@@ -36,7 +36,7 @@ describe Brightbox::CollaboratingAccount do
36
36
  let(:initial_model) { active_collaboration }
37
37
 
38
38
  it "returns false'" do
39
- expect(account.account?).to be_false
39
+ expect(account.account?).to be false
40
40
  end
41
41
  end
42
42
  end
@@ -46,7 +46,7 @@ describe Brightbox::CollaboratingAccount do
46
46
  let(:initial_model) { owned_account }
47
47
 
48
48
  it "returns false" do
49
- expect(account.collaboration?).to be_false
49
+ expect(account.collaboration?).to be false
50
50
  end
51
51
  end
52
52
 
@@ -54,7 +54,7 @@ describe Brightbox::CollaboratingAccount do
54
54
  let(:initial_model) { active_collaboration }
55
55
 
56
56
  it "returns true'" do
57
- expect(account.collaboration?).to be_true
57
+ expect(account.collaboration?).to be true
58
58
  end
59
59
  end
60
60
  end
@@ -11,7 +11,7 @@ describe Brightbox::CollaboratingAccount do
11
11
 
12
12
  it_behaves_like "a wrapped API resource"
13
13
 
14
- it { should respond_to(:ram_free) }
15
- it { should respond_to(:cloud_ip_limit) }
16
- it { should respond_to(:lb_limit) }
14
+ it { is_expected.to respond_to(:ram_free) }
15
+ it { is_expected.to respond_to(:cloud_ip_limit) }
16
+ it { is_expected.to respond_to(:lb_limit) }
17
17
  end
@@ -42,7 +42,7 @@ describe Brightbox::Config::ApiClient do
42
42
  end
43
43
 
44
44
  it "sets persistent correctly" do
45
- expect(for_fog[:persistent]).to be_true
45
+ expect(for_fog[:persistent]).to be true
46
46
  end
47
47
  end
48
48
 
@@ -78,7 +78,7 @@ describe Brightbox::Config::ApiClient do
78
78
  end
79
79
 
80
80
  it "sets persistent correctly" do
81
- expect(for_fog[:persistent]).to be_true
81
+ expect(for_fog[:persistent]).to be false
82
82
  end
83
83
  end
84
84
 
@@ -19,7 +19,7 @@ describe Brightbox::Config::ApiClient do
19
19
  end
20
20
 
21
21
  it "is valid" do
22
- expect(section).to be_valid
22
+ expect(section).to be_valid
23
23
  end
24
24
  end
25
25
 
@@ -35,7 +35,7 @@ describe Brightbox::Config::ApiClient do
35
35
  end
36
36
 
37
37
  it "is valid" do
38
- expect(section).to be_valid
38
+ expect(section).to be_valid
39
39
  end
40
40
  end
41
41
 
@@ -49,7 +49,7 @@ describe Brightbox::Config::ApiClient do
49
49
  end
50
50
 
51
51
  it "is invalid" do
52
- expect(section).to_not be_valid
52
+ expect(section).to_not be_valid
53
53
  end
54
54
  end
55
55
 
@@ -63,7 +63,7 @@ describe Brightbox::Config::ApiClient do
63
63
  end
64
64
 
65
65
  it "is invalid" do
66
- expect(section).to_not be_valid
66
+ expect(section).to_not be_valid
67
67
  end
68
68
  end
69
69
 
@@ -77,7 +77,7 @@ describe Brightbox::Config::ApiClient do
77
77
  end
78
78
 
79
79
  it "is invalid" do
80
- expect(section).to_not be_valid
80
+ expect(section).to_not be_valid
81
81
  end
82
82
  end
83
83
  end
@@ -33,7 +33,7 @@ describe Brightbox::Config::SectionNameDeduplicator do
33
33
 
34
34
  context "when name has been deduped before" do
35
35
  let(:name) { "dev" }
36
- let(:in_use) { ["dev", "dev_1", "dev_2"] }
36
+ let(:in_use) { %w(dev dev_1 dev_2) }
37
37
 
38
38
  it "returns a deduplicated name" do
39
39
  expect(deduper.next).to eql("dev_3")
@@ -9,9 +9,9 @@ describe Brightbox::BBConfig do
9
9
  let(:contents) { "" }
10
10
 
11
11
  it "raises an error" do
12
- expect {
12
+ expect do
13
13
  fog_config
14
- }.to raise_error(Brightbox::BBConfigError)
14
+ end.to raise_error(Brightbox::BBConfigError)
15
15
  end
16
16
  end
17
17
 
@@ -27,7 +27,7 @@ describe Brightbox::BBConfig do
27
27
  let(:contents) { USER_APP_CONFIG_CONTENTS }
28
28
 
29
29
  it "includes the password" do
30
- pending "context is wrong to pass require values through"
30
+ skip "context is wrong to pass require values through"
31
31
  expect(fog_config).to have_key(:brightbox_password)
32
32
  end
33
33
  end
@@ -43,7 +43,7 @@ describe Brightbox::Config::UserApplication do
43
43
  end
44
44
 
45
45
  it "sets persistent correctly" do
46
- expect(for_fog[:persistent]).to be_true
46
+ expect(for_fog[:persistent]).to be true
47
47
  end
48
48
  end
49
49
 
@@ -81,7 +81,7 @@ describe Brightbox::Config::UserApplication do
81
81
  end
82
82
 
83
83
  it "sets persistent correctly" do
84
- expect(for_fog[:persistent]).to be_true
84
+ expect(for_fog[:persistent]).to be false
85
85
  end
86
86
  end
87
87
 
@@ -20,7 +20,7 @@ describe Brightbox::Config::UserApplication do
20
20
  end
21
21
 
22
22
  it "is valid" do
23
- expect(section).to be_valid
23
+ expect(section).to be_valid
24
24
  end
25
25
  end
26
26
 
@@ -37,7 +37,7 @@ describe Brightbox::Config::UserApplication do
37
37
  end
38
38
 
39
39
  it "is valid" do
40
- expect(section).to be_valid
40
+ expect(section).to be_valid
41
41
  end
42
42
  end
43
43
 
@@ -52,7 +52,7 @@ describe Brightbox::Config::UserApplication do
52
52
  end
53
53
 
54
54
  it "is invalid" do
55
- expect(section).to_not be_valid
55
+ expect(section).to_not be_valid
56
56
  end
57
57
  end
58
58
 
@@ -67,7 +67,7 @@ describe Brightbox::Config::UserApplication do
67
67
  end
68
68
 
69
69
  it "is invalid" do
70
- expect(section).to_not be_valid
70
+ expect(section).to_not be_valid
71
71
  end
72
72
  end
73
73
 
@@ -82,7 +82,7 @@ describe Brightbox::Config::UserApplication do
82
82
  end
83
83
 
84
84
  it "is invalid" do
85
- expect(section).to_not be_valid
85
+ expect(section).to_not be_valid
86
86
  end
87
87
  end
88
88
 
@@ -97,7 +97,7 @@ describe Brightbox::Config::UserApplication do
97
97
  end
98
98
 
99
99
  it "is invalid" do
100
- expect(section).to_not be_valid
100
+ expect(section).to_not be_valid
101
101
  end
102
102
  end
103
103
  end
@@ -15,13 +15,13 @@ describe Brightbox::ConnectionManager, "#fetch_connection" do
15
15
 
16
16
  context "when not requesting a scoped connection" do
17
17
  it "returns a fog compute instance" do
18
- connection_manager.fetch_connection(false).should be_kind_of(Fog::Compute::Brightbox::Real)
18
+ expect(connection_manager.fetch_connection(false)).to be_kind_of(Fog::Compute::Brightbox::Real)
19
19
  end
20
20
 
21
21
  it "returns a connection without account scope" do
22
22
  connection = connection_manager.fetch_connection(false)
23
- connection.should_not be_nil
24
- connection.scoped_account.should be_nil
23
+ expect(connection).not_to be_nil
24
+ expect(connection.scoped_account).to be_nil
25
25
  end
26
26
  end
27
27
 
@@ -29,13 +29,13 @@ describe Brightbox::ConnectionManager, "#fetch_connection" do
29
29
  context "when a connection exists" do
30
30
  it "upgrades existing connection with scoped account" do
31
31
  connection = connection_manager.fetch_connection(false)
32
- connection.should_not be_nil
32
+ expect(connection).not_to be_nil
33
33
 
34
34
  expect($config).to receive(:account).and_return("acc-abcde")
35
35
  connection2 = connection_manager.fetch_connection(true)
36
- connection2.should == connection
37
- connection2.scoped_account.should_not be_nil
38
- connection2.scoped_account.should == "acc-abcde"
36
+ expect(connection2).to eq(connection)
37
+ expect(connection2.scoped_account).not_to be_nil
38
+ expect(connection2.scoped_account).to eq("acc-abcde")
39
39
  end
40
40
  end
41
41
  end
@@ -43,30 +43,30 @@ describe Brightbox::ConnectionManager, "#fetch_connection" do
43
43
  context "when a default account setting is set in config" do
44
44
  let(:default_account) { "acc-12345" }
45
45
  let(:selected_config) do
46
- {"default_account" => default_account}
46
+ { "default_account" => default_account }
47
47
  end
48
48
 
49
49
  it "selects configured account" do
50
- pending "Fails out of sequence, mocked config incorrect"
51
- $config.stubs(:selected_config).returns({ 'default_account' => "acc-12345"})
50
+ skip "Fails out of sequence, mocked config incorrect"
51
+ $config.stubs(:selected_config).returns('default_account' => "acc-12345")
52
52
  connection = connection_manager.fetch_connection(true)
53
- connection.should_not be_nil
54
- connection.scoped_account.should == "acc-12345"
53
+ expect(connection).not_to be_nil
54
+ expect(connection.scoped_account).to eq("acc-12345")
55
55
  end
56
56
  end
57
57
 
58
58
  context "when user has one account" do
59
59
  it "selects that account" do
60
- pending "Fails out of sequence, mocked config incorrect"
61
- $config.unstub(:selected_config)
62
- mock_account = mock()
60
+ skip "Fails out of sequence, mocked config incorrect"
61
+ allow($config).to receive(:selected_config).and_call_original
62
+ mock_account = double
63
63
  mock_account.expects(:id).returns("acc-xyg")
64
64
 
65
65
  Brightbox::Account.expects(:all).returns([mock_account])
66
66
 
67
67
  connection = connection_manager.fetch_connection(true)
68
- connection.should_not be_nil
69
- connection.scoped_account.should == "acc-xyg"
68
+ expect(connection).not_to be_nil
69
+ expect(connection.scoped_account).to eq("acc-xyg")
70
70
  end
71
71
  end
72
72
  end
@@ -5,8 +5,8 @@ describe Brightbox::FirewallPolicy do
5
5
  describe "#apply_to", :vcr do
6
6
 
7
7
  it "should apply firewall policy" do
8
- lambda {
9
- params = { :name => "rspec_tests_apply"}
8
+ expect do
9
+ params = { :name => "rspec_tests_apply" }
10
10
  group = Brightbox::ServerGroup.create(params)
11
11
  firewall_options = {
12
12
  :name => "rspec_firewall_policy_apply"
@@ -14,7 +14,7 @@ describe Brightbox::FirewallPolicy do
14
14
  firewall_policy = Brightbox::FirewallPolicy.create(firewall_options)
15
15
  firewall_policy.apply_to(group.id)
16
16
  group.destroy
17
- }.should_not raise_error
17
+ end.not_to raise_error
18
18
  end
19
19
  end
20
20
  end
@@ -5,22 +5,22 @@ describe Brightbox::FirewallPolicy do
5
5
  describe "#create", :vcr do
6
6
 
7
7
  it "should create firewall policy" do
8
- params = { :name => "rspec_tests"}
8
+ params = { :name => "rspec_tests" }
9
9
  @group = Brightbox::ServerGroup.create(params)
10
- lambda do
10
+ expect do
11
11
  firewall_options = {
12
12
  :name => "rspec_firewall_policy",
13
13
  :server_group_id => @group.id
14
14
  }
15
15
  @firewall_policy = Brightbox::FirewallPolicy.create(firewall_options)
16
- end.should_not raise_error
16
+ end.not_to raise_error
17
17
 
18
18
  output = FauxIO.new do
19
- Brightbox.render_table([@firewall_policy],:vertical => true)
19
+ Brightbox.render_table([@firewall_policy], :vertical => true)
20
20
  end
21
21
 
22
22
  expect(output.stdout).to match(/rspec_firewall_policy/)
23
- @group.destroy()
23
+ @group.destroy
24
24
  end
25
25
  end
26
26
  end
@@ -4,17 +4,17 @@ describe Brightbox::FirewallPolicy do
4
4
 
5
5
  describe "#destroy", :vcr do
6
6
  it "should destroy firewall policy" do
7
- params = { :name => "rspec_tests"}
7
+ params = { :name => "rspec_tests" }
8
8
  @group = Brightbox::ServerGroup.create(params)
9
- lambda do
9
+ expect do
10
10
  firewall_options = {
11
11
  :name => "rspec_firewall_policy",
12
12
  :server_group_id => @group.id
13
13
  }
14
14
  @firewall_policy = Brightbox::FirewallPolicy.create(firewall_options)
15
15
  @firewall_policy.destroy
16
- end.should_not raise_error
17
- @group.destroy()
16
+ end.not_to raise_error
17
+ @group.destroy
18
18
  end
19
19
  end
20
20
  end
@@ -14,7 +14,7 @@ describe Brightbox::FirewallPolicy do
14
14
  it "should show firewall policy", :vcr do
15
15
  output = FauxIO.new do
16
16
  firewall_policy = Brightbox::FirewallPolicy.find_or_call([@policy.id])
17
- Brightbox.render_table(firewall_policy,:vertical => true)
17
+ Brightbox.render_table(firewall_policy, :vertical => true)
18
18
  end
19
19
  expect(output.stdout).to include(@policy.id)
20
20
  end
@@ -13,7 +13,7 @@ describe Brightbox::FirewallPolicy do
13
13
  it "should list firewall policy", :vcr do
14
14
  output = FauxIO.new do
15
15
  firewall_policies = Brightbox::FirewallPolicy.find(:all)
16
- Brightbox.render_table(firewall_policies,:vertical => true)
16
+ Brightbox.render_table(firewall_policies, :vertical => true)
17
17
  end
18
18
 
19
19
  expect(output.stdout).to include(@policy.id)
@@ -20,7 +20,7 @@ describe Brightbox::FirewallRule do
20
20
  it "creates the rule successfully", :vcr do
21
21
  @rule = Brightbox::FirewallRule.create(@rule_options)
22
22
  output = FauxIO.new do
23
- Brightbox.render_table([@rule], {:vertical => true})
23
+ Brightbox.render_table([@rule], :vertical => true)
24
24
  end
25
25
 
26
26
  expect(output.stdout).to include(@rule.id)
@@ -18,9 +18,9 @@ describe Brightbox::FirewallRule do
18
18
  end
19
19
 
20
20
  it "destroys a rule" do
21
- expect {
21
+ expect do
22
22
  @rule.destroy
23
- }.to_not raise_error
23
+ end.to_not raise_error
24
24
  end
25
25
  end
26
26
  end
@@ -18,9 +18,9 @@ describe Brightbox::FirewallRule do
18
18
  end
19
19
 
20
20
  it "can display the result" do
21
- expect {
21
+ expect do
22
22
  @rule = Brightbox::FirewallRule.find(@rule.id)
23
- }.to_not raise_error
23
+ end.to_not raise_error
24
24
 
25
25
  display_options = {
26
26
  :fields => [
@@ -33,7 +33,7 @@ describe Brightbox::FirewallRule do
33
33
  :icmp_type,
34
34
  :firewall_policy
35
35
  ],
36
- :vertical => true
36
+ :vertical => true
37
37
  }
38
38
 
39
39
  output = FauxIO.new do
@@ -21,8 +21,8 @@ describe Brightbox::FirewallRule do
21
21
  end
22
22
 
23
23
  it "lists all rules" do
24
- # FIXME from_policy does not seem to reload from API so uses a stale
25
- # representation of the rules (Policy creation above)
24
+ # FIXME: from_policy does not seem to reload from API so uses a stale
25
+ # representation of the rules (Policy creation above)
26
26
  @policy.reload
27
27
  @policy_rules = Brightbox::FirewallRules.from_policy(@policy)
28
28