fog-brightbox 1.10.0 → 1.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +15 -10
  3. data/CHANGELOG.md +17 -0
  4. data/Rakefile +1 -1
  5. data/fog-brightbox.gemspec +5 -3
  6. data/lib/fog/brightbox/compute/shared.rb +11 -10
  7. data/lib/fog/brightbox/compute.rb +20 -21
  8. data/lib/fog/brightbox/config.rb +6 -9
  9. data/lib/fog/brightbox/models/compute/api_client.rb +4 -4
  10. data/lib/fog/brightbox/models/compute/application.rb +2 -2
  11. data/lib/fog/brightbox/models/compute/cloud_ip.rb +11 -11
  12. data/lib/fog/brightbox/models/compute/collaboration.rb +3 -3
  13. data/lib/fog/brightbox/models/compute/collaborations.rb +1 -1
  14. data/lib/fog/brightbox/models/compute/config_map.rb +2 -3
  15. data/lib/fog/brightbox/models/compute/database_server.rb +17 -5
  16. data/lib/fog/brightbox/models/compute/database_snapshot.rb +2 -2
  17. data/lib/fog/brightbox/models/compute/firewall_policy.rb +6 -6
  18. data/lib/fog/brightbox/models/compute/firewall_rule.rb +9 -9
  19. data/lib/fog/brightbox/models/compute/image.rb +9 -9
  20. data/lib/fog/brightbox/models/compute/load_balancer.rb +12 -12
  21. data/lib/fog/brightbox/models/compute/server.rb +21 -23
  22. data/lib/fog/brightbox/models/compute/server_group.rb +6 -6
  23. data/lib/fog/brightbox/models/compute/user.rb +3 -3
  24. data/lib/fog/brightbox/models/compute/volume.rb +16 -16
  25. data/lib/fog/brightbox/models/storage/directories.rb +2 -2
  26. data/lib/fog/brightbox/models/storage/directory.rb +7 -7
  27. data/lib/fog/brightbox/models/storage/file.rb +13 -13
  28. data/lib/fog/brightbox/models/storage/files.rb +9 -13
  29. data/lib/fog/brightbox/oauth2.rb +11 -11
  30. data/lib/fog/brightbox/requests/compute/list_accounts.rb +1 -1
  31. data/lib/fog/brightbox/requests/compute/reset_database_server.rb +21 -0
  32. data/lib/fog/brightbox/requests/compute/resize_database_server.rb +25 -0
  33. data/lib/fog/brightbox/requests/compute/snapshot_database_server.rb +1 -1
  34. data/lib/fog/brightbox/requests/compute/snapshot_server.rb +1 -1
  35. data/lib/fog/brightbox/requests/storage/copy_object.rb +5 -5
  36. data/lib/fog/brightbox/requests/storage/delete_container.rb +3 -3
  37. data/lib/fog/brightbox/requests/storage/delete_multiple_objects.rb +7 -7
  38. data/lib/fog/brightbox/requests/storage/delete_object.rb +3 -3
  39. data/lib/fog/brightbox/requests/storage/delete_static_large_object.rb +6 -6
  40. data/lib/fog/brightbox/requests/storage/get_container.rb +4 -4
  41. data/lib/fog/brightbox/requests/storage/get_containers.rb +4 -4
  42. data/lib/fog/brightbox/requests/storage/get_object.rb +4 -6
  43. data/lib/fog/brightbox/requests/storage/get_object_http_url.rb +1 -1
  44. data/lib/fog/brightbox/requests/storage/get_object_https_url.rb +1 -1
  45. data/lib/fog/brightbox/requests/storage/head_container.rb +4 -4
  46. data/lib/fog/brightbox/requests/storage/head_containers.rb +4 -4
  47. data/lib/fog/brightbox/requests/storage/head_object.rb +3 -3
  48. data/lib/fog/brightbox/requests/storage/post_set_meta_temp_url_key.rb +3 -3
  49. data/lib/fog/brightbox/requests/storage/put_container.rb +4 -4
  50. data/lib/fog/brightbox/requests/storage/put_dynamic_obj_manifest.rb +4 -4
  51. data/lib/fog/brightbox/requests/storage/put_object.rb +7 -7
  52. data/lib/fog/brightbox/requests/storage/put_static_obj_manifest.rb +6 -6
  53. data/lib/fog/brightbox/storage/authentication_request.rb +4 -4
  54. data/lib/fog/brightbox/storage/connection.rb +2 -2
  55. data/lib/fog/brightbox/storage.rb +13 -14
  56. data/lib/fog/brightbox/version.rb +1 -1
  57. data/spec/fog/brightbox/compute/config_spec.rb +4 -4
  58. data/spec/fog/brightbox/compute/get_access_token_spec.rb +28 -28
  59. data/spec/fog/brightbox/compute/wrapped_request_spec.rb +23 -23
  60. data/spec/fog/brightbox/config_spec.rb +23 -23
  61. data/spec/fog/brightbox/oauth2/client_credentials_strategy_spec.rb +2 -2
  62. data/spec/fog/brightbox/oauth2/credential_set_spec.rb +5 -5
  63. data/spec/fog/brightbox/oauth2/grant_type_strategy_spec.rb +2 -2
  64. data/spec/fog/brightbox/oauth2/refresh_token_strategy_spec.rb +3 -3
  65. data/spec/fog/brightbox/oauth2/user_credentials_strategy_spec.rb +4 -4
  66. data/spec/fog/brightbox/storage/authentication_request_spec.rb +34 -34
  67. data/spec/fog/brightbox/storage/config_spec.rb +4 -4
  68. data/spec/fog/brightbox/storage/connection_errors_spec.rb +6 -6
  69. data/spec/fog/brightbox/storage/connection_spec.rb +37 -37
  70. data/spec/fog/brightbox/storage/directory_spec.rb +6 -6
  71. data/spec/fog/brightbox/storage/files_spec.rb +5 -5
  72. data/spec/fog/brightbox/storage_spec.rb +5 -5
  73. data/spec/fog/compute/brightbox/database_server_spec.rb +19 -19
  74. data/spec/fog/compute/brightbox/image_selector_spec.rb +18 -18
  75. data/spec/fog/compute/brightbox/load_balancer_spec.rb +5 -5
  76. data/spec/fog/compute/brightbox/server_spec.rb +44 -44
  77. data/spec/fog/compute/brightbox/volume_spec.rb +68 -69
  78. data/spec/fog/compute/brightbox_spec.rb +10 -10
  79. data/spec/fog/storage/brightbox_spec.rb +83 -83
  80. data/spec/model_setup.rb +9 -9
  81. data/spec/stock_storage_responses.rb +9 -9
  82. data/spec/supports_resource_locking.rb +6 -6
  83. data/tests/brightbox/compute/schema.rb +74 -74
  84. data/tests/brightbox/compute_tests.rb +14 -14
  85. data/tests/brightbox/models/compute/server_tests.rb +0 -1
  86. data/tests/brightbox/requests/compute/account_tests.rb +9 -9
  87. data/tests/brightbox/requests/compute/api_client_tests.rb +9 -9
  88. data/tests/brightbox/requests/compute/application_test.rb +8 -8
  89. data/tests/brightbox/requests/compute/cloud_ip_tests.rb +11 -13
  90. data/tests/brightbox/requests/compute/collaboration_tests.rb +1 -1
  91. data/tests/brightbox/requests/compute/database_server_tests.rb +7 -7
  92. data/tests/brightbox/requests/compute/database_snapsnot_tests.rb +5 -5
  93. data/tests/brightbox/requests/compute/database_type_tests.rb +1 -1
  94. data/tests/brightbox/requests/compute/firewall_policy_tests.rb +7 -7
  95. data/tests/brightbox/requests/compute/firewall_rule_tests.rb +8 -10
  96. data/tests/brightbox/requests/compute/helper.rb +1 -1
  97. data/tests/brightbox/requests/compute/image_tests.rb +2 -2
  98. data/tests/brightbox/requests/compute/interface_tests.rb +1 -1
  99. data/tests/brightbox/requests/compute/load_balancer_tests.rb +23 -23
  100. data/tests/brightbox/requests/compute/server_group_tests.rb +16 -18
  101. data/tests/brightbox/requests/compute/server_tests.rb +12 -12
  102. data/tests/brightbox/requests/compute/server_type_tests.rb +2 -2
  103. data/tests/brightbox/requests/compute/user_tests.rb +4 -4
  104. data/tests/brightbox/requests/compute/volume_tests.rb +5 -5
  105. data/tests/brightbox/requests/compute/zone_tests.rb +2 -2
  106. data/tests/helper.rb +1 -1
  107. data/tests/helpers/collection_helper.rb +16 -23
  108. data/tests/helpers/compute/server_helper.rb +4 -6
  109. data/tests/helpers/formats_helper.rb +5 -5
  110. data/tests/helpers/formats_helper_tests.rb +16 -16
  111. data/tests/helpers/mock_helper.rb +84 -86
  112. data/tests/helpers/model_helper.rb +1 -3
  113. data/tests/helpers/schema_validator_tests.rb +14 -14
  114. metadata +17 -2
  115. data/.rubocop_todo.yml +0 -81
@@ -1,47 +1,47 @@
1
1
  Shindo.tests("Fog::Compute[:brightbox] | api client requests", ["brightbox"]) do
2
2
  tests("success") do
3
3
  create_options = {
4
- :name => "Fog@#{Time.now.iso8601}",
5
- :description => "Description from Fog test"
4
+ name: "Fog@#{Time.now.iso8601}",
5
+ description: "Description from Fog test"
6
6
  }
7
7
 
8
8
  tests("#create_api_client(#{create_options.inspect})") do
9
9
  pending if Fog.mocking?
10
10
  result = Fog::Compute[:brightbox].create_api_client(create_options)
11
11
  @api_client_id = result["id"]
12
- data_matches_schema(Brightbox::Compute::Formats::Full::API_CLIENT, :allow_extra_keys => true) { result }
12
+ data_matches_schema(Brightbox::Compute::Formats::Full::API_CLIENT, allow_extra_keys: true) { result }
13
13
  end
14
14
 
15
15
  tests("#list_api_clients") do
16
16
  pending if Fog.mocking?
17
17
  result = Fog::Compute[:brightbox].list_api_clients
18
- data_matches_schema(Brightbox::Compute::Formats::Collection::API_CLIENTS, :allow_extra_keys => true) { result }
18
+ data_matches_schema(Brightbox::Compute::Formats::Collection::API_CLIENTS, allow_extra_keys: true) { result }
19
19
  end
20
20
 
21
21
  tests("#get_api_client('#{@api_client_id}')") do
22
22
  pending if Fog.mocking?
23
23
  result = Fog::Compute[:brightbox].get_api_client(@api_client_id)
24
- data_matches_schema(Brightbox::Compute::Formats::Full::API_CLIENT, :allow_extra_keys => true) { result }
24
+ data_matches_schema(Brightbox::Compute::Formats::Full::API_CLIENT, allow_extra_keys: true) { result }
25
25
  end
26
26
 
27
- update_options = { :name => "Fog@#{Time.now.iso8601}" }
27
+ update_options = { name: "Fog@#{Time.now.iso8601}" }
28
28
  tests("#update_api_client('#{@api_client_id}', #{update_options.inspect})") do
29
29
  pending if Fog.mocking?
30
30
  result = Fog::Compute[:brightbox].update_api_client(@api_client_id, update_options)
31
- data_matches_schema(Brightbox::Compute::Formats::Full::API_CLIENT, :allow_extra_keys => true) { result }
31
+ data_matches_schema(Brightbox::Compute::Formats::Full::API_CLIENT, allow_extra_keys: true) { result }
32
32
  end
33
33
 
34
34
  tests("#reset_secret_api_client('#{@api_client_id}')") do
35
35
  pending if Fog.mocking?
36
36
  result = Fog::Compute[:brightbox].reset_secret_api_client(@api_client_id)
37
- data_matches_schema(Brightbox::Compute::Formats::Full::API_CLIENT, :allow_extra_keys => true) { result }
37
+ data_matches_schema(Brightbox::Compute::Formats::Full::API_CLIENT, allow_extra_keys: true) { result }
38
38
  test("new secret is visible") { !result["secret"].nil? }
39
39
  end
40
40
 
41
41
  tests("#delete_api_client('#{@api_client_id}')") do
42
42
  pending if Fog.mocking?
43
43
  result = Fog::Compute[:brightbox].delete_api_client(@api_client_id)
44
- data_matches_schema(Brightbox::Compute::Formats::Full::API_CLIENT, :allow_extra_keys => true) { result }
44
+ data_matches_schema(Brightbox::Compute::Formats::Full::API_CLIENT, allow_extra_keys: true) { result }
45
45
  end
46
46
  end
47
47
 
@@ -1,46 +1,46 @@
1
1
  Shindo.tests("Fog::Compute[:brightbox] | api client requests", ["brightbox"]) do
2
2
  tests("success") do
3
3
  create_options = {
4
- :name => "Fog@#{Time.now.iso8601}"
4
+ name: "Fog@#{Time.now.iso8601}"
5
5
  }
6
6
 
7
7
  tests("#create_application(#{create_options.inspect})") do
8
8
  pending if Fog.mocking?
9
9
  result = Fog::Compute[:brightbox].create_application(create_options)
10
10
  @application_id = result["id"]
11
- data_matches_schema(Brightbox::Compute::Formats::Full::APPLICATION, :allow_extra_keys => true) { result }
11
+ data_matches_schema(Brightbox::Compute::Formats::Full::APPLICATION, allow_extra_keys: true) { result }
12
12
  end
13
13
 
14
14
  tests("#list_applications") do
15
15
  pending if Fog.mocking?
16
16
  result = Fog::Compute[:brightbox].list_applications
17
- data_matches_schema(Brightbox::Compute::Formats::Collection::APPLICATION, :allow_extra_keys => true) { result }
17
+ data_matches_schema(Brightbox::Compute::Formats::Collection::APPLICATION, allow_extra_keys: true) { result }
18
18
  end
19
19
 
20
20
  tests("#get_application('#{@application_id}')") do
21
21
  pending if Fog.mocking?
22
22
  result = Fog::Compute[:brightbox].get_application(@application_id)
23
- data_matches_schema(Brightbox::Compute::Formats::Full::APPLICATION, :allow_extra_keys => true) { result }
23
+ data_matches_schema(Brightbox::Compute::Formats::Full::APPLICATION, allow_extra_keys: true) { result }
24
24
  end
25
25
 
26
- update_options = { :name => "Fog@#{Time.now.iso8601}" }
26
+ update_options = { name: "Fog@#{Time.now.iso8601}" }
27
27
  tests("#update_application('#{@application_id}', #{update_options.inspect})") do
28
28
  pending if Fog.mocking?
29
29
  result = Fog::Compute[:brightbox].update_application(@application_id, update_options)
30
- data_matches_schema(Brightbox::Compute::Formats::Full::APPLICATION, :allow_extra_keys => true) { result }
30
+ data_matches_schema(Brightbox::Compute::Formats::Full::APPLICATION, allow_extra_keys: true) { result }
31
31
  end
32
32
 
33
33
  tests("#reset_secret_application('#{@application_id}')") do
34
34
  pending if Fog.mocking?
35
35
  result = Fog::Compute[:brightbox].reset_secret_application(@application_id)
36
- data_matches_schema(Brightbox::Compute::Formats::Full::APPLICATION, :allow_extra_keys => true) { result }
36
+ data_matches_schema(Brightbox::Compute::Formats::Full::APPLICATION, allow_extra_keys: true) { result }
37
37
  test("new secret is visible") { !result["secret"].nil? }
38
38
  end
39
39
 
40
40
  tests("#delete_application('#{@application_id}')") do
41
41
  pending if Fog.mocking?
42
42
  result = Fog::Compute[:brightbox].delete_application(@application_id)
43
- data_matches_schema(Brightbox::Compute::Formats::Full::APPLICATION, :allow_extra_keys => true) { result }
43
+ data_matches_schema(Brightbox::Compute::Formats::Full::APPLICATION, allow_extra_keys: true) { result }
44
44
  end
45
45
  end
46
46
 
@@ -8,29 +8,29 @@ Shindo.tests("Fog::Compute[:brightbox] | cloud ip requests", ["brightbox"]) do
8
8
  pending if Fog.mocking?
9
9
  result = Fog::Compute[:brightbox].create_cloud_ip
10
10
  @cloud_ip_id = result["id"]
11
- data_matches_schema(Brightbox::Compute::Formats::Full::CLOUD_IP, :allow_extra_keys => true) { result }
11
+ data_matches_schema(Brightbox::Compute::Formats::Full::CLOUD_IP, allow_extra_keys: true) { result }
12
12
  end
13
13
 
14
14
  tests("#list_cloud_ips") do
15
15
  pending if Fog.mocking?
16
16
  result = Fog::Compute[:brightbox].list_cloud_ips
17
- data_matches_schema(Brightbox::Compute::Formats::Collection::CLOUD_IPS, :allow_extra_keys => true) { result }
17
+ data_matches_schema(Brightbox::Compute::Formats::Collection::CLOUD_IPS, allow_extra_keys: true) { result }
18
18
  end
19
19
 
20
20
  tests("#get_cloud_ip('#{@cloud_ip_id}')") do
21
21
  pending if Fog.mocking?
22
22
  result = Fog::Compute[:brightbox].get_cloud_ip(@cloud_ip_id)
23
- data_matches_schema(Brightbox::Compute::Formats::Full::CLOUD_IP, :allow_extra_keys => true) { result }
23
+ data_matches_schema(Brightbox::Compute::Formats::Full::CLOUD_IP, allow_extra_keys: true) { result }
24
24
  end
25
25
 
26
26
  unless Fog.mocking?
27
- map_options = { :destination => @server.interfaces.first["id"] }
27
+ map_options = { destination: @server.interfaces.first["id"] }
28
28
  end
29
29
 
30
30
  tests("#map_cloud_ip('#{@cloud_ip_id}', #{map_options.inspect})") do
31
31
  pending if Fog.mocking?
32
32
  result = Fog::Compute[:brightbox].map_cloud_ip(@cloud_ip_id, map_options)
33
- data_matches_schema(Brightbox::Compute::Formats::Full::CLOUD_IP, :allow_extra_keys => true) { result }
33
+ data_matches_schema(Brightbox::Compute::Formats::Full::CLOUD_IP, allow_extra_keys: true) { result }
34
34
  end
35
35
 
36
36
  unless Fog.mocking?
@@ -40,29 +40,27 @@ Shindo.tests("Fog::Compute[:brightbox] | cloud ip requests", ["brightbox"]) do
40
40
  tests("#unmap_cloud_ip('#{@cloud_ip_id}')") do
41
41
  pending if Fog.mocking?
42
42
  result = Fog::Compute[:brightbox].unmap_cloud_ip(@cloud_ip_id)
43
- data_matches_schema(Brightbox::Compute::Formats::Full::CLOUD_IP, :allow_extra_keys => true) { result }
43
+ data_matches_schema(Brightbox::Compute::Formats::Full::CLOUD_IP, allow_extra_keys: true) { result }
44
44
  end
45
45
 
46
46
  unless Fog.mocking?
47
- update_options = { :reverse_dns => "public.#{@server.id}.gb1.brightbox.com" }
47
+ update_options = { reverse_dns: "public.#{@server.id}.gb1.brightbox.com" }
48
48
  end
49
49
 
50
50
  tests("#update_cloud_ip('#{@cloud_ip_id}', #{update_options.inspect})") do
51
51
  pending if Fog.mocking?
52
52
  result = Fog::Compute[:brightbox].update_cloud_ip(@cloud_ip_id, update_options)
53
- data_matches_schema(Brightbox::Compute::Formats::Full::CLOUD_IP, :allow_extra_keys => true) { result }
54
- result = Fog::Compute[:brightbox].update_cloud_ip(@cloud_ip_id, :reverse_dns => "")
53
+ data_matches_schema(Brightbox::Compute::Formats::Full::CLOUD_IP, allow_extra_keys: true) { result }
54
+ result = Fog::Compute[:brightbox].update_cloud_ip(@cloud_ip_id, reverse_dns: "")
55
55
  end
56
56
 
57
57
  tests("#delete_cloud_ip('#{@cloud_ip_id}')") do
58
58
  pending if Fog.mocking?
59
59
  result = Fog::Compute[:brightbox].delete_cloud_ip(@cloud_ip_id)
60
- data_matches_schema(Brightbox::Compute::Formats::Full::CLOUD_IP, :allow_extra_keys => true) { result }
60
+ data_matches_schema(Brightbox::Compute::Formats::Full::CLOUD_IP, allow_extra_keys: true) { result }
61
61
  end
62
62
 
63
- unless Fog.mocking?
64
- @server.destroy
65
- end
63
+ @server.destroy unless Fog.mocking?
66
64
  end
67
65
 
68
66
  tests("failure") do
@@ -5,7 +5,7 @@ Shindo.tests("Fog::Compute[:brightbox] | collaboration requests", ["brightbox"])
5
5
 
6
6
  tests("#create_collaboration") do
7
7
  pending if Fog.mocking?
8
- collaboration = Fog::Compute[:brightbox].create_collaboration(:email => @test_collaborator_email, :role => "admin")
8
+ collaboration = Fog::Compute[:brightbox].create_collaboration(email: @test_collaborator_email, role: "admin")
9
9
  @collaboration_id = collaboration["id"]
10
10
  formats(Brightbox::Compute::Formats::Full::COLLABORATION, false) { collaboration }
11
11
  end
@@ -6,38 +6,38 @@ Shindo.tests("Fog::Compute[:brightbox] | database server requests", ["brightbox"
6
6
  tests("#create_database_server(#{create_options.inspect})") do
7
7
  result = Fog::Compute[:brightbox].create_database_server(create_options)
8
8
  @database_server_id = result["id"]
9
- data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SERVER, :allow_extra_keys => true) { result }
9
+ data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SERVER, allow_extra_keys: true) { result }
10
10
  end
11
11
 
12
12
  tests("#list_database_servers") do
13
13
  result = Fog::Compute[:brightbox].list_database_servers
14
- data_matches_schema(Brightbox::Compute::Formats::Collection::DATABASE_SERVERS, :allow_extra_keys => true) { result }
14
+ data_matches_schema(Brightbox::Compute::Formats::Collection::DATABASE_SERVERS, allow_extra_keys: true) { result }
15
15
  end
16
16
 
17
17
  tests("#get_database_server('#{@database_server_id}')") do
18
18
  result = Fog::Compute[:brightbox].get_database_server(@database_server_id)
19
- data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SERVER, :allow_extra_keys => true) { result }
19
+ data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SERVER, allow_extra_keys: true) { result }
20
20
  end
21
21
 
22
22
  update_options = {
23
- :name => "New name"
23
+ name: "New name"
24
24
  }
25
25
  tests("#update_database_server('#{@database_server_id}', update_options)") do
26
26
  result = Fog::Compute[:brightbox].update_database_server(@database_server_id, update_options)
27
- data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SERVER, :allow_extra_keys => true) { result }
27
+ data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SERVER, allow_extra_keys: true) { result }
28
28
  end
29
29
 
30
30
  Fog::Compute[:brightbox].database_servers.get(@database_server_id).wait_for { ready? }
31
31
 
32
32
  tests("#reset_password_database_server('#{@database_server_id}')") do
33
33
  result = Fog::Compute[:brightbox].reset_password_database_server(@database_server_id)
34
- data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SERVER, :allow_extra_keys => true) { result }
34
+ data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SERVER, allow_extra_keys: true) { result }
35
35
  test("new password is visible") { !result["admin_password"].nil? }
36
36
  end
37
37
 
38
38
  tests("#delete_database_server('#{@database_server_id}')") do
39
39
  result = Fog::Compute[:brightbox].delete_database_server(@database_server_id)
40
- data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SERVER, :allow_extra_keys => true) { result }
40
+ data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SERVER, allow_extra_keys: true) { result }
41
41
  end
42
42
  end
43
43
 
@@ -11,7 +11,7 @@ Shindo.tests("Fog::Compute[:brightbox] | database snapshot requests", ["brightbo
11
11
 
12
12
  tests("#list_database_snapshots") do
13
13
  result = service.list_database_snapshots
14
- data_matches_schema(Brightbox::Compute::Formats::Collection::DATABASE_SNAPSHOTS, :allow_extra_keys => true) { result }
14
+ data_matches_schema(Brightbox::Compute::Formats::Collection::DATABASE_SNAPSHOTS, allow_extra_keys: true) { result }
15
15
  @database_snapshot_id = result.last["id"]
16
16
  end
17
17
 
@@ -21,20 +21,20 @@ Shindo.tests("Fog::Compute[:brightbox] | database snapshot requests", ["brightbo
21
21
 
22
22
  tests("#get_database_snapshot('#{@database_snapshot_id}')") do
23
23
  result = service.get_database_snapshot(@database_snapshot_id)
24
- data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, :allow_extra_keys => true) { result }
24
+ data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, allow_extra_keys: true) { result }
25
25
  end
26
26
 
27
27
  update_options = {
28
- :name => "New name"
28
+ name: "New name"
29
29
  }
30
30
  tests("#update_database_snapshot('#{@database_snapshot_id}', update_options)") do
31
31
  result = service.update_database_snapshot(@database_snapshot_id, update_options)
32
- data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, :allow_extra_keys => true) { result }
32
+ data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, allow_extra_keys: true) { result }
33
33
  end
34
34
 
35
35
  tests("#delete_database_snapshot('#{@database_snapshot_id}')") do
36
36
  result = service.delete_database_snapshot(@database_snapshot_id)
37
- data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, :allow_extra_keys => true) { result }
37
+ data_matches_schema(Brightbox::Compute::Formats::Full::DATABASE_SNAPSHOT, allow_extra_keys: true) { result }
38
38
  end
39
39
  end
40
40
 
@@ -3,7 +3,7 @@ Shindo.tests("Fog::Compute[:brightbox] | database type requests", ["brightbox"])
3
3
  tests("#list_database_types") do
4
4
  pending if Fog.mocking?
5
5
  result = Fog::Compute[:brightbox].list_database_types
6
- data_matches_schema(Brightbox::Compute::Formats::Collection::DATABASE_SERVER_TYPES, :allow_extra_keys => true) { result }
6
+ data_matches_schema(Brightbox::Compute::Formats::Collection::DATABASE_SERVER_TYPES, allow_extra_keys: true) { result }
7
7
  end
8
8
  end
9
9
 
@@ -3,37 +3,37 @@ Shindo.tests("Fog::Compute[:brightbox] | firewall policy requests", ["brightbox"
3
3
  pending if Fog.mocking?
4
4
 
5
5
  create_options = {
6
- :name => "Fog test policy A"
6
+ name: "Fog test policy A"
7
7
  }
8
8
 
9
9
  tests("#create_firewall_policy(#{create_options.inspect})") do
10
10
  result = Fog::Compute[:brightbox].create_firewall_policy(create_options)
11
11
  @firewall_policy_id = result["id"]
12
- data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_POLICY, :allow_extra_keys => true) { result }
12
+ data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_POLICY, allow_extra_keys: true) { result }
13
13
  end
14
14
 
15
15
  tests("#list_firewall_policies()") do
16
- data_matches_schema(Brightbox::Compute::Formats::Collection::FIREWALL_POLICIES, :allow_extra_keys => true) do
16
+ data_matches_schema(Brightbox::Compute::Formats::Collection::FIREWALL_POLICIES, allow_extra_keys: true) do
17
17
  Fog::Compute[:brightbox].list_firewall_policies
18
18
  end
19
19
  end
20
20
 
21
21
  tests("#get_firewall_policy('#{@firewall_policy_id}')") do
22
- data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_POLICY, :allow_extra_keys => true) do
22
+ data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_POLICY, allow_extra_keys: true) do
23
23
  Fog::Compute[:brightbox].get_firewall_policy(@firewall_policy_id)
24
24
  end
25
25
  end
26
26
 
27
- update_options = { :name => "Fog test policy B" }
27
+ update_options = { name: "Fog test policy B" }
28
28
  tests("#update_firewall_policy('#{@firewall_policy_id}', #{update_options.inspect})") do
29
29
  result = Fog::Compute[:brightbox].update_firewall_policy(@firewall_policy_id, update_options)
30
- data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_POLICY, :allow_extra_keys => true) { result }
30
+ data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_POLICY, allow_extra_keys: true) { result }
31
31
  returns("Fog test policy B") { result["name"] }
32
32
  end
33
33
 
34
34
  tests("#delete_firewall_policy('#{@firewall_policy_id}')") do
35
35
  result = Fog::Compute[:brightbox].delete_firewall_policy(@firewall_policy_id)
36
- data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_POLICY, :allow_extra_keys => true) { result }
36
+ data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_POLICY, allow_extra_keys: true) { result }
37
37
  end
38
38
  end
39
39
  end
@@ -7,36 +7,34 @@ Shindo.tests("Fog::Compute[:brightbox] | firewall rule requests", ["brightbox"])
7
7
  end
8
8
 
9
9
  create_options = {
10
- :firewall_policy => policy.id,
11
- :destination => "127.0.0.1"
10
+ firewall_policy: policy.id,
11
+ destination: "127.0.0.1"
12
12
  }
13
13
 
14
14
  tests("#create_firewall_rule(#{create_options.inspect})") do
15
15
  result = Fog::Compute[:brightbox].create_firewall_rule(create_options)
16
16
  @firewall_rule_id = result["id"]
17
- data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_RULE, :allow_extra_keys => true) { result }
17
+ data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_RULE, allow_extra_keys: true) { result }
18
18
  end
19
19
 
20
20
  tests("#get_firewall_rule('#{@firewall_rule_id}')") do
21
- data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_RULE, :allow_extra_keys => true) do
21
+ data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_RULE, allow_extra_keys: true) do
22
22
  Fog::Compute[:brightbox].get_firewall_rule(@firewall_rule_id)
23
23
  end
24
24
  end
25
25
 
26
- update_options = { :source => nil, :destination => "127.0.0.1" }
26
+ update_options = { source: nil, destination: "127.0.0.1" }
27
27
  tests("#update_firewall_rule('#{@firewall_rule_id}', #{update_options.inspect})") do
28
- data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_RULE, :allow_extra_keys => true) do
28
+ data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_RULE, allow_extra_keys: true) do
29
29
  Fog::Compute[:brightbox].update_firewall_rule(@firewall_rule_id, update_options)
30
30
  end
31
31
  end
32
32
 
33
33
  tests("#delete_firewall_rule('#{@firewall_rule_id}')") do
34
34
  result = Fog::Compute[:brightbox].delete_firewall_rule(@firewall_rule_id)
35
- data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_RULE, :allow_extra_keys => true) { result }
35
+ data_matches_schema(Brightbox::Compute::Formats::Full::FIREWALL_RULE, allow_extra_keys: true) { result }
36
36
  end
37
37
 
38
- unless Fog.mocking?
39
- policy.destroy
40
- end
38
+ policy.destroy unless Fog.mocking?
41
39
  end
42
40
  end
@@ -19,7 +19,7 @@ class Brightbox
19
19
 
20
20
  # Prepare a test server, wait for it to be usable but raise if it fails
21
21
  def self.get_test_server
22
- test_server_options = { :image_id => image_id }
22
+ test_server_options = { image_id: image_id }
23
23
  server = Fog::Compute[:brightbox].servers.create(test_server_options)
24
24
  server.wait_for do
25
25
  raise "Test server failed to build" if state == "failed"
@@ -17,13 +17,13 @@ Shindo.tests("Fog::Compute[:brightbox] | image requests", ["brightbox"]) do
17
17
  pending if Fog.mocking?
18
18
  result = Fog::Compute[:brightbox].list_images
19
19
  @image_id = result.first["id"]
20
- data_matches_schema(Brightbox::Compute::Formats::Collection::IMAGES, :allow_extra_keys => true) { result }
20
+ data_matches_schema(Brightbox::Compute::Formats::Collection::IMAGES, allow_extra_keys: true) { result }
21
21
  end
22
22
 
23
23
  tests("#get_image('#{@image_id}')") do
24
24
  pending if Fog.mocking?
25
25
  result = Fog::Compute[:brightbox].get_image(@image_id)
26
- data_matches_schema(Brightbox::Compute::Formats::Full::IMAGE, :allow_extra_keys => true) { result }
26
+ data_matches_schema(Brightbox::Compute::Formats::Full::IMAGE, allow_extra_keys: true) { result }
27
27
  end
28
28
 
29
29
  ## Until Image creation can be automated, we shouldn't be updating Images randomly
@@ -9,7 +9,7 @@ Shindo.tests("Fog::Compute[:brightbox] | interface requests", ["brightbox"]) do
9
9
  tests("#get_interface('#{@interface_id}')") do
10
10
  pending if Fog.mocking?
11
11
  result = @test_service.get_interface(@interface_id)
12
- data_matches_schema(Brightbox::Compute::Formats::Full::INTERFACE, :allow_extra_keys => true) { result }
12
+ data_matches_schema(Brightbox::Compute::Formats::Full::INTERFACE, allow_extra_keys: true) { result }
13
13
  end
14
14
 
15
15
  @test_server.destroy
@@ -6,17 +6,17 @@ Shindo.tests("Fog::Compute[:brightbox] | load balancer requests", ["brightbox"])
6
6
  end
7
7
 
8
8
  create_options = {
9
- :nodes => [{
10
- :node => node_id
9
+ nodes: [{
10
+ node: node_id
11
11
  }],
12
- :listeners => [{
13
- :in => 80,
14
- :out => 8080,
15
- :protocol => "http"
12
+ listeners: [{
13
+ in: 80,
14
+ out: 8080,
15
+ protocol: "http"
16
16
  }],
17
- :healthcheck => {
18
- :type => "http",
19
- :port => 80
17
+ healthcheck: {
18
+ type: "http",
19
+ port: 80
20
20
  }
21
21
  }
22
22
 
@@ -24,7 +24,7 @@ Shindo.tests("Fog::Compute[:brightbox] | load balancer requests", ["brightbox"])
24
24
  pending if Fog.mocking?
25
25
  result = Fog::Compute[:brightbox].create_load_balancer(create_options)
26
26
  @load_balancer_id = result["id"]
27
- data_matches_schema(Brightbox::Compute::Formats::Full::LOAD_BALANCER, :allow_extra_keys => true) { result }
27
+ data_matches_schema(Brightbox::Compute::Formats::Full::LOAD_BALANCER, allow_extra_keys: true) { result }
28
28
  end
29
29
 
30
30
  unless Fog.mocking?
@@ -34,34 +34,34 @@ Shindo.tests("Fog::Compute[:brightbox] | load balancer requests", ["brightbox"])
34
34
  tests("#list_load_balancers()") do
35
35
  pending if Fog.mocking?
36
36
  result = Fog::Compute[:brightbox].list_load_balancers
37
- data_matches_schema(Brightbox::Compute::Formats::Collection::LOAD_BALANCERS, :allow_extra_keys => true) { result }
37
+ data_matches_schema(Brightbox::Compute::Formats::Collection::LOAD_BALANCERS, allow_extra_keys: true) { result }
38
38
  end
39
39
 
40
40
  tests("#get_load_balancer('#{@load_balancer_id}')") do
41
41
  pending if Fog.mocking?
42
42
  result = Fog::Compute[:brightbox].get_load_balancer(@load_balancer_id)
43
- data_matches_schema(Brightbox::Compute::Formats::Full::LOAD_BALANCER, :allow_extra_keys => true) { result }
43
+ data_matches_schema(Brightbox::Compute::Formats::Full::LOAD_BALANCER, allow_extra_keys: true) { result }
44
44
  end
45
45
 
46
- update_options = { :name => "New name" }
46
+ update_options = { name: "New name" }
47
47
  tests("#update_load_balancer('#{@load_balancer_id}', #{update_options.inspect})") do
48
48
  pending if Fog.mocking?
49
49
  result = Fog::Compute[:brightbox].update_load_balancer(@load_balancer_id, update_options)
50
- data_matches_schema(Brightbox::Compute::Formats::Full::LOAD_BALANCER, :allow_extra_keys => true) { result }
50
+ data_matches_schema(Brightbox::Compute::Formats::Full::LOAD_BALANCER, allow_extra_keys: true) { result }
51
51
  end
52
52
 
53
- add_listeners_options = { :listeners => [{ :out => 28_080, :in => 8080, :protocol => "http" }] }
53
+ add_listeners_options = { listeners: [{ out: 28_080, in: 8080, protocol: "http" }] }
54
54
  tests("#add_listeners_load_balancer('#{@load_balancer_id}', #{add_listeners_options.inspect})") do
55
55
  pending if Fog.mocking?
56
56
  result = Fog::Compute[:brightbox].add_listeners_load_balancer(@load_balancer_id, add_listeners_options)
57
- data_matches_schema(Brightbox::Compute::Formats::Full::LOAD_BALANCER, :allow_extra_keys => true) { result }
57
+ data_matches_schema(Brightbox::Compute::Formats::Full::LOAD_BALANCER, allow_extra_keys: true) { result }
58
58
  end
59
59
 
60
- remove_listeners_options = { :listeners => [{ :out => 28_080, :in => 8080, :protocol => "http" }] }
60
+ remove_listeners_options = { listeners: [{ out: 28_080, in: 8080, protocol: "http" }] }
61
61
  tests("#remove_listeners_load_balancer('#{@load_balancer_id}', #{remove_listeners_options.inspect})") do
62
62
  pending if Fog.mocking?
63
63
  result = Fog::Compute[:brightbox].remove_listeners_load_balancer(@load_balancer_id, remove_listeners_options)
64
- data_matches_schema(Brightbox::Compute::Formats::Full::LOAD_BALANCER, :allow_extra_keys => true) { result }
64
+ data_matches_schema(Brightbox::Compute::Formats::Full::LOAD_BALANCER, allow_extra_keys: true) { result }
65
65
  end
66
66
 
67
67
  unless Fog.mocking?
@@ -70,25 +70,25 @@ Shindo.tests("Fog::Compute[:brightbox] | load balancer requests", ["brightbox"])
70
70
  end
71
71
 
72
72
  # Can't remove the last node so we need to add a second...
73
- add_nodes_options = { :nodes => [{ :node => second_node_id }] }
73
+ add_nodes_options = { nodes: [{ node: second_node_id }] }
74
74
  tests("#add_nodes_load_balancer('#{@load_balancer_id}', #{add_nodes_options.inspect})") do
75
75
  pending if Fog.mocking?
76
76
  result = Fog::Compute[:brightbox].add_nodes_load_balancer(@load_balancer_id, add_nodes_options)
77
- data_matches_schema(Brightbox::Compute::Formats::Full::LOAD_BALANCER, :allow_extra_keys => true) { result }
77
+ data_matches_schema(Brightbox::Compute::Formats::Full::LOAD_BALANCER, allow_extra_keys: true) { result }
78
78
  end
79
79
 
80
80
  # ...before we can attempt to remove either
81
- remove_nodes_options = { :nodes => [{ :node => node_id }] }
81
+ remove_nodes_options = { nodes: [{ node: node_id }] }
82
82
  tests("#remove_nodes_load_balancer('#{@load_balancer_id}', #{remove_nodes_options.inspect})") do
83
83
  pending if Fog.mocking?
84
84
  result = Fog::Compute[:brightbox].remove_nodes_load_balancer(@load_balancer_id, remove_nodes_options)
85
- data_matches_schema(Brightbox::Compute::Formats::Full::LOAD_BALANCER, :allow_extra_keys => true) { result }
85
+ data_matches_schema(Brightbox::Compute::Formats::Full::LOAD_BALANCER, allow_extra_keys: true) { result }
86
86
  end
87
87
 
88
88
  tests("#delete_load_balancer('#{@load_balancer_id}')") do
89
89
  pending if Fog.mocking?
90
90
  result = Fog::Compute[:brightbox].delete_load_balancer(@load_balancer_id)
91
- data_matches_schema(Brightbox::Compute::Formats::Full::LOAD_BALANCER, :allow_extra_keys => true) { result }
91
+ data_matches_schema(Brightbox::Compute::Formats::Full::LOAD_BALANCER, allow_extra_keys: true) { result }
92
92
  end
93
93
 
94
94
  unless Fog.mocking?
@@ -6,9 +6,9 @@ Shindo.tests("Fog::Compute[:brightbox] | server group requests", ["brightbox"])
6
6
  end
7
7
 
8
8
  create_options = {
9
- :name => "Fog@#{Time.now.iso8601}",
10
- :servers => [{
11
- :server => server_id
9
+ name: "Fog@#{Time.now.iso8601}",
10
+ servers: [{
11
+ server: server_id
12
12
  }]
13
13
  }
14
14
 
@@ -16,60 +16,58 @@ Shindo.tests("Fog::Compute[:brightbox] | server group requests", ["brightbox"])
16
16
  pending if Fog.mocking?
17
17
  result = Fog::Compute[:brightbox].create_server_group(create_options)
18
18
  @server_group_id = result["id"]
19
- data_matches_schema(Brightbox::Compute::Formats::Full::SERVER_GROUP, :allow_extra_keys => true) { result }
19
+ data_matches_schema(Brightbox::Compute::Formats::Full::SERVER_GROUP, allow_extra_keys: true) { result }
20
20
  end
21
21
 
22
22
  tests("#list_server_groups") do
23
23
  pending if Fog.mocking?
24
24
  result = Fog::Compute[:brightbox].list_server_groups
25
- data_matches_schema(Brightbox::Compute::Formats::Collection::SERVER_GROUPS, :allow_extra_keys => true) { result }
25
+ data_matches_schema(Brightbox::Compute::Formats::Collection::SERVER_GROUPS, allow_extra_keys: true) { result }
26
26
  @default_group_id = result.find { |grp| grp["default"] == true }["id"]
27
27
  end
28
28
 
29
29
  tests("#get_server_group('#{@server_group_id}')") do
30
30
  pending if Fog.mocking?
31
31
  result = Fog::Compute[:brightbox].get_server_group(@server_group_id)
32
- data_matches_schema(Brightbox::Compute::Formats::Full::SERVER_GROUP, :allow_extra_keys => true) { result }
32
+ data_matches_schema(Brightbox::Compute::Formats::Full::SERVER_GROUP, allow_extra_keys: true) { result }
33
33
  end
34
34
 
35
- update_options = { :name => "Fog@#{Time.now.iso8601}" }
35
+ update_options = { name: "Fog@#{Time.now.iso8601}" }
36
36
  tests("#update_server_group('#{@server_group_id}', #{update_options.inspect})") do
37
37
  pending if Fog.mocking?
38
38
  result = Fog::Compute[:brightbox].update_server_group(@server_group_id, update_options)
39
- data_matches_schema(Brightbox::Compute::Formats::Full::SERVER_GROUP, :allow_extra_keys => true) { result }
39
+ data_matches_schema(Brightbox::Compute::Formats::Full::SERVER_GROUP, allow_extra_keys: true) { result }
40
40
  end
41
41
 
42
- remove_options = { :servers => [{ :server => server_id }] }
42
+ remove_options = { servers: [{ server: server_id }] }
43
43
  tests("#remove_servers_server_group('#{@server_group_id}', #{remove_options.inspect})") do
44
44
  pending if Fog.mocking?
45
45
  result = Fog::Compute[:brightbox].remove_servers_server_group(@server_group_id, remove_options)
46
- data_matches_schema(Brightbox::Compute::Formats::Full::SERVER_GROUP, :allow_extra_keys => true) { result }
46
+ data_matches_schema(Brightbox::Compute::Formats::Full::SERVER_GROUP, allow_extra_keys: true) { result }
47
47
  end
48
48
 
49
- add_options = { :servers => [{ :server => server_id }] }
49
+ add_options = { servers: [{ server: server_id }] }
50
50
  tests("#add_servers_server_group('#{@server_group_id}', #{remove_options.inspect})") do
51
51
  pending if Fog.mocking?
52
52
  result = Fog::Compute[:brightbox].add_servers_server_group(@server_group_id, add_options)
53
- data_matches_schema(Brightbox::Compute::Formats::Full::SERVER_GROUP, :allow_extra_keys => true) { result }
53
+ data_matches_schema(Brightbox::Compute::Formats::Full::SERVER_GROUP, allow_extra_keys: true) { result }
54
54
  end
55
55
 
56
- move_options = { :destination => @default_group_id, :servers => [{ :server => server_id }] }
56
+ move_options = { destination: @default_group_id, servers: [{ server: server_id }] }
57
57
  tests("#move_servers_server_group('#{@server_group_id}', #{move_options.inspect})") do
58
58
  pending if Fog.mocking?
59
59
  result = Fog::Compute[:brightbox].move_servers_server_group(@server_group_id, move_options)
60
- data_matches_schema(Brightbox::Compute::Formats::Full::SERVER_GROUP, :allow_extra_keys => true) { result }
60
+ data_matches_schema(Brightbox::Compute::Formats::Full::SERVER_GROUP, allow_extra_keys: true) { result }
61
61
  test("group is emptied") { result["servers"].empty? }
62
62
  end
63
63
 
64
64
  tests("#delete_server_group('#{@server_group_id}')") do
65
65
  pending if Fog.mocking?
66
66
  result = Fog::Compute[:brightbox].delete_server_group(@server_group_id)
67
- data_matches_schema(Brightbox::Compute::Formats::Full::SERVER_GROUP, :allow_extra_keys => true) { result }
67
+ data_matches_schema(Brightbox::Compute::Formats::Full::SERVER_GROUP, allow_extra_keys: true) { result }
68
68
  end
69
69
 
70
- unless Fog.mocking?
71
- @server.destroy
72
- end
70
+ @server.destroy unless Fog.mocking?
73
71
  end
74
72
 
75
73
  tests("failure") do