Add and apply Style/HashTransformValues rule

The `transform_values` method is available since Ruby 2.5.
This commit is contained in:
Javi Martín
2021-08-11 20:34:44 +02:00
parent 5b00df0565
commit 53aa1770a2
2 changed files with 4 additions and 3 deletions

View File

@@ -1,8 +1,6 @@
shared_examples "remotely_translatable" do |factory_name, path_name, path_arguments|
let(:arguments) do
path_arguments.map do |argument_name, path_to_value|
[argument_name, resource.send(path_to_value)]
end.to_h
path_arguments.transform_values { |path_to_value| resource.send(path_to_value) }
end
let(:path) { send(path_name, arguments) }
let!(:resource) { create(factory_name) }