tests/helpers/model_helper.rb in fog-aws-3.3.0 vs tests/helpers/model_helper.rb in fog-aws-3.4.0
- old
+ new
@@ -1,20 +1,19 @@
def model_tests(collection, params = {}, mocks_implemented = true)
tests('success') do
-
@instance = collection.new(params)
- tests("#save").succeeds do
+ tests('#save').succeeds do
pending if Fog.mocking? && !mocks_implemented
@instance.save
end
if block_given?
yield(@instance)
end
- tests("#destroy").succeeds do
+ tests('#destroy').succeeds do
pending if Fog.mocking? && !mocks_implemented
@instance.destroy
end
end
@@ -24,8 +23,8 @@
# Useful when rapidly re-running tests, so we don't have to wait
# serveral minutes for deleted objects to disappear from the API
# E.g. 'fog-test-1234'
def uniq_id(base_name = 'fog-test')
# random_differentiator
- suffix = rand(65536).to_s(16).rjust(4, '0')
- [base_name, suffix] * '-'
+ suffix = rand(65_536).to_s(16).rjust(4, '0')
+ [base_name, suffix].join('-')
end