fog-core 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +2 -0
- data/.github/workflows/ruby.yml +1 -1
- data/.github/workflows/stale.yml +1 -1
- data/.rubocop.yml +16 -12
- data/.rubocop_todo.yml +724 -0
- data/Gemfile +1 -1
- data/Rakefile +2 -14
- data/changelog.md +14 -0
- data/fog-core.gemspec +10 -7
- data/lib/fog/compute/models/server.rb +7 -3
- data/lib/fog/compute.rb +2 -2
- data/lib/fog/core/association.rb +1 -0
- data/lib/fog/core/attributes/default.rb +7 -0
- data/lib/fog/core/attributes.rb +28 -3
- data/lib/fog/core/cache.rb +58 -55
- data/lib/fog/core/collection.rb +9 -3
- data/lib/fog/core/connection.rb +1 -1
- data/lib/fog/core/current_machine.rb +1 -1
- data/lib/fog/core/errors.rb +1 -1
- data/lib/fog/core/logger.rb +2 -2
- data/lib/fog/core/mock.rb +6 -1
- data/lib/fog/core/model.rb +34 -5
- data/lib/fog/core/provider.rb +7 -7
- data/lib/fog/core/scp.rb +15 -11
- data/lib/fog/core/service.rb +4 -4
- data/lib/fog/core/services_mixin.rb +9 -9
- data/lib/fog/core/ssh.rb +3 -2
- data/lib/fog/core/stringify_keys.rb +0 -2
- data/lib/fog/core/time.rb +2 -2
- data/lib/fog/core/uuid.rb +2 -8
- data/lib/fog/core/version.rb +1 -1
- data/lib/fog/core/wait_for.rb +2 -1
- data/lib/fog/core/wait_for_defaults.rb +2 -0
- data/lib/fog/core.rb +57 -58
- data/lib/fog/formatador.rb +7 -6
- data/lib/fog/schema/data_validator.rb +1 -0
- data/lib/fog/storage.rb +15 -15
- data/lib/fog/test_helpers/collection_helper.rb +2 -0
- data/lib/fog/test_helpers/formats_helper.rb +2 -2
- data/lib/fog/test_helpers/helper.rb +3 -3
- data/lib/fog/test_helpers/minitest/assertions.rb +1 -1
- data/lib/fog/test_helpers/minitest/expectations.rb +1 -1
- data/lib/fog/test_helpers/mock_helper.rb +84 -84
- data/lib/fog/test_helpers/types_helper.rb +1 -0
- data/lib/tasks/test_task.rb +2 -2
- data/spec/compute/models/server_spec.rb +7 -7
- data/spec/compute_spec.rb +6 -6
- data/spec/connection_spec.rb +11 -9
- data/spec/core/cache_spec.rb +51 -15
- data/spec/core/collection_spec.rb +24 -0
- data/spec/core/model_spec.rb +36 -3
- data/spec/core/stringify_keys_spec.rb +3 -3
- data/spec/core/whitelist_keys_spec.rb +2 -2
- data/spec/current_machine_spec.rb +2 -2
- data/spec/fog_attribute_spec.rb +183 -163
- data/spec/formatador_spec.rb +7 -7
- data/spec/identity_spec.rb +6 -6
- data/spec/mocking_spec.rb +3 -3
- data/spec/service_spec.rb +19 -19
- data/spec/spec_helper.rb +3 -8
- data/spec/storage_spec.rb +6 -6
- data/spec/test_helpers/formats_helper_spec.rb +8 -8
- data/spec/test_helpers/schema_validator_spec.rb +8 -8
- data/spec/utils_spec.rb +6 -6
- data/spec/wait_for_spec.rb +2 -2
- metadata +44 -53
data/spec/formatador_spec.rb
CHANGED
@@ -26,15 +26,15 @@ describe Fog::Formatador do
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
@collection = @collection_class.new(:
|
30
|
-
@collection << @member_class.new(:
|
29
|
+
@collection = @collection_class.new(attr_one: "String", attr_two: 5)
|
30
|
+
@collection << @member_class.new(name: "Member name")
|
31
31
|
@expected = <<-EOS.gsub(/^ {6}/, "").chomp!
|
32
32
|
<InspectionGadget
|
33
|
-
attr_one
|
33
|
+
attr_one="String",
|
34
34
|
attr_two=5
|
35
35
|
[
|
36
36
|
<MemberGadget
|
37
|
-
name
|
37
|
+
name="Member name"
|
38
38
|
>
|
39
39
|
]
|
40
40
|
>
|
@@ -78,18 +78,18 @@ describe Fog::Formatador do
|
|
78
78
|
self
|
79
79
|
end
|
80
80
|
end
|
81
|
-
@collection = @collection_class.new(:
|
81
|
+
@collection = @collection_class.new(name: "Name")
|
82
82
|
@collection << "this"
|
83
83
|
end
|
84
84
|
|
85
85
|
it "returns formatted representation" do
|
86
86
|
@expected = <<-EOS.gsub(/^ {6}/, "").chomp!
|
87
87
|
<
|
88
|
-
name
|
88
|
+
name="Name"
|
89
89
|
>
|
90
90
|
EOS
|
91
91
|
|
92
|
-
opts = { :
|
92
|
+
opts = { include_nested: false }
|
93
93
|
Fog::Formatador.format(@collection, opts).must_equal @expected
|
94
94
|
end
|
95
95
|
end
|
data/spec/identity_spec.rb
CHANGED
@@ -24,7 +24,7 @@ describe "Fog::Identity" do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
it "instantiates an instance of Fog::Identity::<Provider> from the :provider keyword arg" do
|
27
|
-
identity = Fog::Identity.new(:
|
27
|
+
identity = Fog::Identity.new(provider: :therightway)
|
28
28
|
assert_instance_of(Fog::TheRightWay::Identity, identity)
|
29
29
|
end
|
30
30
|
|
@@ -44,7 +44,7 @@ describe "Fog::Identity" do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
it "instantiates an instance of Fog::<Provider>::Identity from the :provider keyword arg" do
|
47
|
-
identity = Fog::Identity.new(:
|
47
|
+
identity = Fog::Identity.new(provider: :thewrongway)
|
48
48
|
assert_instance_of(Fog::Identity::TheWrongWay, identity)
|
49
49
|
end
|
50
50
|
|
@@ -76,19 +76,19 @@ describe "Fog::Identity" do
|
|
76
76
|
|
77
77
|
describe "when both Fog::Identity::<Provider> and Fog::<Provider>::Identity exist" do
|
78
78
|
it "prefers Fog::Identity::<Provider>" do
|
79
|
-
identity = Fog::Identity.new(:
|
79
|
+
identity = Fog::Identity.new(provider: :bothways)
|
80
80
|
assert_instance_of(Fog::BothWays::Identity, identity)
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
84
|
it "passes the supplied keyword args less :provider to Fog::Identity::<Provider>#new" do
|
85
|
-
identity = Fog::Identity.new(:
|
86
|
-
assert_equal({ :
|
85
|
+
identity = Fog::Identity.new(provider: :bothways, extra: :stuff)
|
86
|
+
assert_equal({ extra: :stuff }, identity.args)
|
87
87
|
end
|
88
88
|
|
89
89
|
it "raises ArgumentError when given a :provider where a Fog::Identity::Provider that does not exist" do
|
90
90
|
assert_raises(ArgumentError) do
|
91
|
-
Fog::Identity.new(:
|
91
|
+
Fog::Identity.new(provider: :wat)
|
92
92
|
end
|
93
93
|
end
|
94
94
|
end
|
data/spec/mocking_spec.rb
CHANGED
@@ -60,16 +60,16 @@ describe "Fog mocking" do
|
|
60
60
|
end
|
61
61
|
|
62
62
|
it "supports explicit request for v4" do
|
63
|
-
assert IPAddr.new(Fog::Mock.random_ip(:
|
63
|
+
assert IPAddr.new(Fog::Mock.random_ip(version: :v4)).ipv4?
|
64
64
|
end
|
65
65
|
|
66
66
|
it "supports explicit request for v6" do
|
67
|
-
assert IPAddr.new(Fog::Mock.random_ip(:
|
67
|
+
assert IPAddr.new(Fog::Mock.random_ip(version: :v6)).ipv6?
|
68
68
|
end
|
69
69
|
|
70
70
|
it "raises when supplied an illegal IP version" do
|
71
71
|
assert_raises(ArgumentError) do
|
72
|
-
IPAddr.new(Fog::Mock.random_ip(:
|
72
|
+
IPAddr.new(Fog::Mock.random_ip(version: :v5)).ipv4?
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
data/spec/service_spec.rb
CHANGED
@@ -32,10 +32,10 @@ describe Fog::Service do
|
|
32
32
|
"User-Agent" => "Generic Fog Client"
|
33
33
|
}
|
34
34
|
params = {
|
35
|
-
:
|
36
|
-
:
|
37
|
-
:
|
38
|
-
:
|
35
|
+
generic_user: "bob",
|
36
|
+
generic_api_key: "1234",
|
37
|
+
connection_options: {
|
38
|
+
headers: user_agent_hash
|
39
39
|
}
|
40
40
|
}
|
41
41
|
service = TestService.new(params)
|
@@ -54,27 +54,27 @@ describe Fog::Service do
|
|
54
54
|
end
|
55
55
|
|
56
56
|
it "removes keys with `nil` values" do
|
57
|
-
service = TestService.new :
|
57
|
+
service = TestService.new generic_api_key: "abc", generic_user: nil
|
58
58
|
refute_includes service.options.keys, :generic_user
|
59
59
|
end
|
60
60
|
|
61
61
|
it "converts number String values with to_i" do
|
62
|
-
service = TestService.new :
|
62
|
+
service = TestService.new generic_api_key: "3421"
|
63
63
|
assert_equal 3421, service.options[:generic_api_key]
|
64
64
|
end
|
65
65
|
|
66
66
|
it "converts 'true' String values to TrueClass" do
|
67
|
-
service = TestService.new :
|
67
|
+
service = TestService.new generic_api_key: "true"
|
68
68
|
assert_equal true, service.options[:generic_api_key]
|
69
69
|
end
|
70
70
|
|
71
71
|
it "converts 'false' String values to FalseClass" do
|
72
|
-
service = TestService.new :
|
72
|
+
service = TestService.new generic_api_key: "false"
|
73
73
|
assert_equal false, service.options[:generic_api_key]
|
74
74
|
end
|
75
75
|
|
76
76
|
it "warns for unrecognised options" do
|
77
|
-
bad_options = { :
|
77
|
+
bad_options = { generic_api_key: "abc", bad_option: "bad value" }
|
78
78
|
logger = Minitest::Mock.new
|
79
79
|
logger.expect :warning, nil, ["Unrecognized arguments: bad_option"]
|
80
80
|
Fog.stub_const :Logger, logger do
|
@@ -87,14 +87,14 @@ describe Fog::Service do
|
|
87
87
|
describe "when creating and mocking is disabled" do
|
88
88
|
it "returns the real service" do
|
89
89
|
Fog.stub :mocking?, false do
|
90
|
-
service = TestService.new(:
|
90
|
+
service = TestService.new(generic_api_key: "abc")
|
91
91
|
service.must_be_instance_of TestService::Real
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
95
|
it "TestService::Real has TestService::Collections mixed into the mocked service" do
|
96
96
|
Fog.stub :mocking?, false do
|
97
|
-
service = TestService.new(:
|
97
|
+
service = TestService.new(generic_api_key: "abc")
|
98
98
|
assert_includes(service.class.ancestors, TestService::Collections)
|
99
99
|
assert_includes(service.class.ancestors, Fog::Service::Collections)
|
100
100
|
refute_includes(service.class.ancestors, ChildOfTestService::Collections)
|
@@ -114,14 +114,14 @@ describe Fog::Service do
|
|
114
114
|
describe "when creating and mocking is enabled" do
|
115
115
|
it "returns mocked service" do
|
116
116
|
Fog.stub :mocking?, true do
|
117
|
-
service = TestService.new(:
|
117
|
+
service = TestService.new(generic_api_key: "abc")
|
118
118
|
service.must_be_instance_of TestService::Mock
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
122
|
it "TestService::Mock has TestService::Collections mixed into the mocked service" do
|
123
123
|
Fog.stub :mocking?, true do
|
124
|
-
service = TestService.new(:
|
124
|
+
service = TestService.new(generic_api_key: "abc")
|
125
125
|
assert_includes(service.class.ancestors, Fog::Service::Collections)
|
126
126
|
assert_includes(service.class.ancestors, TestService::Collections)
|
127
127
|
refute_includes(service.class.ancestors, ChildOfTestService::Collections)
|
@@ -141,8 +141,8 @@ describe Fog::Service do
|
|
141
141
|
describe "when no credentials are provided" do
|
142
142
|
it "uses the global values" do
|
143
143
|
@global_credentials = {
|
144
|
-
:
|
145
|
-
:
|
144
|
+
generic_user: "fog",
|
145
|
+
generic_api_key: "fog"
|
146
146
|
}
|
147
147
|
|
148
148
|
Fog.stub :credentials, @global_credentials do
|
@@ -155,11 +155,11 @@ describe Fog::Service do
|
|
155
155
|
describe "when credentials are provided as settings" do
|
156
156
|
it "merges the global values into settings" do
|
157
157
|
@settings = {
|
158
|
-
:
|
158
|
+
generic_user: "fog"
|
159
159
|
}
|
160
160
|
@global_credentials = {
|
161
|
-
:
|
162
|
-
:
|
161
|
+
generic_user: "bob",
|
162
|
+
generic_api_key: "fog"
|
163
163
|
}
|
164
164
|
|
165
165
|
Fog.stub :credentials, @global_credentials do
|
@@ -172,7 +172,7 @@ describe Fog::Service do
|
|
172
172
|
|
173
173
|
describe "when config object can configure the service itself" do
|
174
174
|
it "ignores the global and its values" do
|
175
|
-
@config =
|
175
|
+
@config = Minitest::Mock.new
|
176
176
|
def @config.config_service?; true; end
|
177
177
|
def @config.nil?; false; end
|
178
178
|
def @config.==(other); object_id == other.object_id; end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,11 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
SimpleCov.start do
|
6
|
-
add_filter "/spec/"
|
7
|
-
end
|
8
|
-
end
|
1
|
+
# Set home outside of real user
|
2
|
+
require "tmpdir"
|
3
|
+
ENV["HOME"] = Dir.mktmpdir("foghome")
|
9
4
|
|
10
5
|
require "minitest/autorun"
|
11
6
|
require "minitest/spec"
|
data/spec/storage_spec.rb
CHANGED
@@ -24,7 +24,7 @@ describe "Fog::Storage" do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
it "instantiates an instance of Fog::<Provider>::Storage from the :provider keyword arg" do
|
27
|
-
compute = Fog::Storage.new(:
|
27
|
+
compute = Fog::Storage.new(provider: :therightway)
|
28
28
|
assert_instance_of(Fog::TheRightWay::Storage, compute)
|
29
29
|
end
|
30
30
|
|
@@ -42,7 +42,7 @@ describe "Fog::Storage" do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
it "instantiates an instance of Fog::Storage::<Provider> from the :provider keyword arg" do
|
45
|
-
compute = Fog::Storage.new(:
|
45
|
+
compute = Fog::Storage.new(provider: :thewrongway)
|
46
46
|
assert_instance_of(Fog::Storage::TheWrongWay, compute)
|
47
47
|
end
|
48
48
|
|
@@ -75,19 +75,19 @@ describe "Fog::Storage" do
|
|
75
75
|
|
76
76
|
describe "when both Fog::Storage::<Provider> and Fog::<Provider>::Storage exist" do
|
77
77
|
it "prefers Fog::Storage::<Provider>" do
|
78
|
-
compute = Fog::Storage.new(:
|
78
|
+
compute = Fog::Storage.new(provider: :bothways)
|
79
79
|
assert_instance_of(Fog::BothWays::Storage, compute)
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
83
|
it "passes the supplied keyword args less :provider to Fog::Storage::<Provider>#new" do
|
84
|
-
compute = Fog::Storage.new(:
|
85
|
-
assert_equal({ :
|
84
|
+
compute = Fog::Storage.new(provider: :bothways, extra: :stuff)
|
85
|
+
assert_equal({ extra: :stuff }, compute.args)
|
86
86
|
end
|
87
87
|
|
88
88
|
it "raises ArgumentError when given a :provider where a Fog::Storage::Provider that does not exist" do
|
89
89
|
assert_raises(ArgumentError) do
|
90
|
-
Fog::Storage.new(:
|
90
|
+
Fog::Storage.new(provider: :wat)
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
@@ -14,8 +14,8 @@ describe "formats_helper" do
|
|
14
14
|
let(:shindo) { Shindo::Tests.new }
|
15
15
|
|
16
16
|
it "comparing welcome data against schema" do
|
17
|
-
data = { :
|
18
|
-
assert shindo.data_matches_schema(:
|
17
|
+
data = { welcome: "Hello" }
|
18
|
+
assert shindo.data_matches_schema(welcome: String) { data }
|
19
19
|
end
|
20
20
|
|
21
21
|
describe "#data_matches_schema" do
|
@@ -28,7 +28,7 @@ describe "formats_helper" do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it "when nested values match schema expectation" do
|
31
|
-
assert shindo.data_matches_schema("key" => { :
|
31
|
+
assert shindo.data_matches_schema("key" => { nested_key: String }) { { "key" => { nested_key: "Value" } } }
|
32
32
|
end
|
33
33
|
|
34
34
|
it "when collection of values all match schema expectation" do
|
@@ -36,11 +36,11 @@ describe "formats_helper" do
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it "when collection is empty although schema covers optional members" do
|
39
|
-
assert shindo.data_matches_schema([{ "key" => String }], :
|
39
|
+
assert shindo.data_matches_schema([{ "key" => String }], allow_optional_rules: true) { [] }
|
40
40
|
end
|
41
41
|
|
42
42
|
it "when additional keys are passed and not strict" do
|
43
|
-
assert shindo.data_matches_schema({ "key" => String }, { :
|
43
|
+
assert shindo.data_matches_schema({ "key" => String }, { allow_extra_keys: true }) { { "key" => "Value", :extra => "Bonus" } }
|
44
44
|
end
|
45
45
|
|
46
46
|
it "when value is nil and schema expects NilClass" do
|
@@ -60,11 +60,11 @@ describe "formats_helper" do
|
|
60
60
|
end
|
61
61
|
|
62
62
|
it "when key is missing but value should be NilClass (#1477)" do
|
63
|
-
assert shindo.data_matches_schema({ "key" => NilClass }, { :
|
63
|
+
assert shindo.data_matches_schema({ "key" => NilClass }, { allow_optional_rules: true }) { {} }
|
64
64
|
end
|
65
65
|
|
66
66
|
it "when key is missing but value is nullable (#1477)" do
|
67
|
-
assert shindo.data_matches_schema({ "key" => Fog::Nullable::String }, { :
|
67
|
+
assert shindo.data_matches_schema({ "key" => Fog::Nullable::String }, { allow_optional_rules: true }) { {} }
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
@@ -79,7 +79,7 @@ describe "formats_helper" do
|
|
79
79
|
end
|
80
80
|
|
81
81
|
it "when nested values match schema expectation" do
|
82
|
-
assert shindo.formats("key" => { :
|
82
|
+
assert shindo.formats("key" => { nested_key: String }) { { "key" => { nested_key: "Value" } } }
|
83
83
|
end
|
84
84
|
|
85
85
|
it "when collection of values all match schema expectation" do
|
@@ -15,7 +15,7 @@ describe "SchemaValidator" do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
it "returns true when nested values match schema expectation" do
|
18
|
-
assert validator.validate({ "key" => { :
|
18
|
+
assert validator.validate({ "key" => { nested_key: "Value" } }, { "key" => { nested_key: String } })
|
19
19
|
end
|
20
20
|
|
21
21
|
it "returns true when collection of values all match schema expectation" do
|
@@ -27,7 +27,7 @@ describe "SchemaValidator" do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
it "returns true when additional keys are passed and not strict" do
|
30
|
-
assert validator.validate({ "key" => "Value", :extra => "Bonus" }, { "key" => String }, { :
|
30
|
+
assert validator.validate({ "key" => "Value", :extra => "Bonus" }, { "key" => String }, { allow_extra_keys: true })
|
31
31
|
end
|
32
32
|
|
33
33
|
it "returns true when value is nil and schema expects NilClass" do
|
@@ -47,11 +47,11 @@ describe "SchemaValidator" do
|
|
47
47
|
end
|
48
48
|
|
49
49
|
it "returns true when key is missing but value should be NilClass (#1477)" do
|
50
|
-
assert validator.validate({}, { "key" => NilClass }, { :
|
50
|
+
assert validator.validate({}, { "key" => NilClass }, { allow_optional_rules: true })
|
51
51
|
end
|
52
52
|
|
53
53
|
it "returns true when key is missing but value is nullable (#1477)" do
|
54
|
-
assert validator.validate({}, { "key" => Fog::Nullable::String }, { :
|
54
|
+
assert validator.validate({}, { "key" => Fog::Nullable::String }, { allow_optional_rules: true })
|
55
55
|
end
|
56
56
|
|
57
57
|
it "returns false when value does not match schema expectation" do
|
@@ -59,7 +59,7 @@ describe "SchemaValidator" do
|
|
59
59
|
end
|
60
60
|
|
61
61
|
it "returns false when key formats do not match" do
|
62
|
-
refute validator.validate({ "key" => "Value" }, { :
|
62
|
+
refute validator.validate({ "key" => "Value" }, { key: String })
|
63
63
|
end
|
64
64
|
|
65
65
|
it "returns false when additional keys are passed and strict" do
|
@@ -87,15 +87,15 @@ describe "SchemaValidator" do
|
|
87
87
|
end
|
88
88
|
|
89
89
|
it "returns false when a hash is expected but another data type is found" do
|
90
|
-
refute validator.validate({ "key" => { :
|
90
|
+
refute validator.validate({ "key" => { nested_key: [] } }, { "key" => { nested_key: {} } })
|
91
91
|
end
|
92
92
|
|
93
93
|
it "returns false when key is missing but value should be NilClass (#1477)" do
|
94
|
-
refute validator.validate({}, { "key" => NilClass }, { :
|
94
|
+
refute validator.validate({}, { "key" => NilClass }, { allow_optional_rules: false })
|
95
95
|
end
|
96
96
|
|
97
97
|
it "returns false when key is missing but value is nullable (#1477)" do
|
98
|
-
refute validator.validate({}, { "key" => Fog::Nullable::String }, { :
|
98
|
+
refute validator.validate({}, { "key" => Fog::Nullable::String }, { allow_optional_rules: false })
|
99
99
|
end
|
100
100
|
end
|
101
101
|
end
|
data/spec/utils_spec.rb
CHANGED
@@ -4,25 +4,25 @@ describe Fog::Core::Utils do
|
|
4
4
|
describe "prepare_service_settings" do
|
5
5
|
it "changes String keys to be Symbols" do
|
6
6
|
settings = { "a" => 3 }
|
7
|
-
expected = { :
|
7
|
+
expected = { a: 3 }
|
8
8
|
assert_equal expected, Fog::Core::Utils.prepare_service_settings(settings)
|
9
9
|
end
|
10
10
|
|
11
11
|
it "leaves Symbol keys unchanged" do
|
12
|
-
settings = { :
|
13
|
-
expected = { :
|
12
|
+
settings = { something: 2 }
|
13
|
+
expected = { something: 2 }
|
14
14
|
assert_equal expected, Fog::Core::Utils.prepare_service_settings(settings)
|
15
15
|
end
|
16
16
|
|
17
17
|
it "changes nested String keys to Symbols" do
|
18
18
|
settings = { "connection_options" => { "val" => 5 } }
|
19
|
-
expected = { :
|
19
|
+
expected = { connection_options: { val: 5 } }
|
20
20
|
assert_equal expected, Fog::Core::Utils.prepare_service_settings(settings)
|
21
21
|
end
|
22
22
|
|
23
23
|
it "does not change the :header key or contents" do
|
24
|
-
settings = { :
|
25
|
-
expected = { :
|
24
|
+
settings = { headers: { "User-Agent" => "my user agent" } }
|
25
|
+
expected = { headers: { "User-Agent" => "my user agent" } }
|
26
26
|
assert_equal expected, Fog::Core::Utils.prepare_service_settings(settings)
|
27
27
|
end
|
28
28
|
end
|
data/spec/wait_for_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe "Fog#wait_for" do
|
4
4
|
it "returns a Hash indicating the wait duration if successful" do
|
5
|
-
assert_equal({ :
|
5
|
+
assert_equal({ duration: 0 }, Fog.wait_for(1) { true })
|
6
6
|
end
|
7
7
|
|
8
8
|
it "raises if the wait timeout is exceeded" do
|
@@ -14,7 +14,7 @@ describe "Fog#wait_for" do
|
|
14
14
|
it "does not raise if successful when the wait timeout is exceeded" do
|
15
15
|
timeout = 2
|
16
16
|
i = 0
|
17
|
-
ret = Fog.wait_for(timeout) { i
|
17
|
+
ret = Fog.wait_for(timeout) { i += 1; i > 2 }
|
18
18
|
assert_operator(ret[:duration], :>, timeout)
|
19
19
|
end
|
20
20
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Light
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-01-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: builder
|
@@ -25,20 +25,6 @@ dependencies:
|
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
name: mime-types
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - ">="
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '0'
|
35
|
-
type: :runtime
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - ">="
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: '0'
|
42
28
|
- !ruby/object:Gem::Dependency
|
43
29
|
name: excon
|
44
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,7 +60,21 @@ dependencies:
|
|
74
60
|
- !ruby/object:Gem::Version
|
75
61
|
version: '2.0'
|
76
62
|
- !ruby/object:Gem::Dependency
|
77
|
-
name:
|
63
|
+
name: mime-types
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
type: :runtime
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
name: minitest
|
78
78
|
requirement: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ">="
|
@@ -88,7 +88,7 @@ dependencies:
|
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
- !ruby/object:Gem::Dependency
|
91
|
-
name:
|
91
|
+
name: minitest-stub-const
|
92
92
|
requirement: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
@@ -102,7 +102,7 @@ dependencies:
|
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
|
-
name:
|
105
|
+
name: pry
|
106
106
|
requirement: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
@@ -116,7 +116,7 @@ dependencies:
|
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
- !ruby/object:Gem::Dependency
|
119
|
-
name:
|
119
|
+
name: rake
|
120
120
|
requirement: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - ">="
|
@@ -130,7 +130,7 @@ dependencies:
|
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
- !ruby/object:Gem::Dependency
|
133
|
-
name:
|
133
|
+
name: rubocop
|
134
134
|
requirement: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
@@ -144,7 +144,7 @@ dependencies:
|
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
- !ruby/object:Gem::Dependency
|
147
|
-
name:
|
147
|
+
name: rubocop-minitest
|
148
148
|
requirement: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - ">="
|
@@ -158,7 +158,7 @@ dependencies:
|
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
- !ruby/object:Gem::Dependency
|
161
|
-
name: rubocop
|
161
|
+
name: rubocop-rake
|
162
162
|
requirement: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - ">="
|
@@ -185,6 +185,20 @@ dependencies:
|
|
185
185
|
- - ">="
|
186
186
|
- !ruby/object:Gem::Version
|
187
187
|
version: '0'
|
188
|
+
- !ruby/object:Gem::Dependency
|
189
|
+
name: tins
|
190
|
+
requirement: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
type: :development
|
196
|
+
prerelease: false
|
197
|
+
version_requirements: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
188
202
|
- !ruby/object:Gem::Dependency
|
189
203
|
name: yard
|
190
204
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,6 +226,7 @@ files:
|
|
212
226
|
- ".github/workflows/stale.yml"
|
213
227
|
- ".gitignore"
|
214
228
|
- ".rubocop.yml"
|
229
|
+
- ".rubocop_todo.yml"
|
215
230
|
- CONTRIBUTING.md
|
216
231
|
- CONTRIBUTORS.md
|
217
232
|
- Gemfile
|
@@ -301,6 +316,7 @@ files:
|
|
301
316
|
- spec/compute_spec.rb
|
302
317
|
- spec/connection_spec.rb
|
303
318
|
- spec/core/cache_spec.rb
|
319
|
+
- spec/core/collection_spec.rb
|
304
320
|
- spec/core/model_spec.rb
|
305
321
|
- spec/core/stringify_keys_spec.rb
|
306
322
|
- spec/core/whitelist_keys_spec.rb
|
@@ -326,7 +342,8 @@ files:
|
|
326
342
|
homepage: https://github.com/fog/fog-core
|
327
343
|
licenses:
|
328
344
|
- MIT
|
329
|
-
metadata:
|
345
|
+
metadata:
|
346
|
+
rubygems_mfa_required: 'true'
|
330
347
|
post_install_message:
|
331
348
|
rdoc_options: []
|
332
349
|
require_paths:
|
@@ -335,41 +352,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
335
352
|
requirements:
|
336
353
|
- - ">="
|
337
354
|
- !ruby/object:Gem::Version
|
338
|
-
version: 2.0
|
355
|
+
version: '2.0'
|
339
356
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
340
357
|
requirements:
|
341
358
|
- - ">="
|
342
359
|
- !ruby/object:Gem::Version
|
343
360
|
version: '0'
|
344
361
|
requirements: []
|
345
|
-
rubygems_version: 3.
|
362
|
+
rubygems_version: 3.4.10
|
346
363
|
signing_key:
|
347
364
|
specification_version: 4
|
348
365
|
summary: Shared classes and tests for fog providers and services.
|
349
|
-
test_files:
|
350
|
-
- spec/compute/models/server_spec.rb
|
351
|
-
- spec/compute_spec.rb
|
352
|
-
- spec/connection_spec.rb
|
353
|
-
- spec/core/cache_spec.rb
|
354
|
-
- spec/core/model_spec.rb
|
355
|
-
- spec/core/stringify_keys_spec.rb
|
356
|
-
- spec/core/whitelist_keys_spec.rb
|
357
|
-
- spec/credentials_spec.rb
|
358
|
-
- spec/current_machine_spec.rb
|
359
|
-
- spec/fake_app/fake_service.rb
|
360
|
-
- spec/fake_app/models/collection.rb
|
361
|
-
- spec/fake_app/models/model.rb
|
362
|
-
- spec/fake_app/requests/request.rb
|
363
|
-
- spec/fog_attribute_spec.rb
|
364
|
-
- spec/formatador_spec.rb
|
365
|
-
- spec/identity_spec.rb
|
366
|
-
- spec/mocking_spec.rb
|
367
|
-
- spec/service_spec.rb
|
368
|
-
- spec/spec_helper.rb
|
369
|
-
- spec/storage_spec.rb
|
370
|
-
- spec/test_helpers/formats_helper_spec.rb
|
371
|
-
- spec/test_helpers/schema_validator_spec.rb
|
372
|
-
- spec/timeout_spec.rb
|
373
|
-
- spec/utils_spec.rb
|
374
|
-
- spec/uuid_spec.rb
|
375
|
-
- spec/wait_for_spec.rb
|
366
|
+
test_files: []
|