From da1390364784b068df0bdf1132e765431f911543 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 17 Dec 2023 11:42:42 +0100 Subject: [PATCH] Autocorrect Performance/StringIdentifierArgument --- lib/aruba/basic_configuration.rb | 2 +- lib/aruba/cucumber/command.rb | 16 ++++++++-------- spec/support/shared_contexts/aruba.rb | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/aruba/basic_configuration.rb b/lib/aruba/basic_configuration.rb index eee77d9f0..f99a701e7 100644 --- a/lib/aruba/basic_configuration.rb +++ b/lib/aruba/basic_configuration.rb @@ -52,7 +52,7 @@ def option_accessor(name, type:, default: nil) add_option(name, block_given? ? yield(InConfigWrapper.new(known_options)) : default) Contract type => type - define_method("#{name}=") { |v| find_option(name).value = v } + define_method(:"#{name}=") { |v| find_option(name).value = v } # Add reader option_reader name, type: type diff --git a/lib/aruba/cucumber/command.rb b/lib/aruba/cucumber/command.rb index c4f99145e..62d625c27 100644 --- a/lib/aruba/cucumber/command.rb +++ b/lib/aruba/cucumber/command.rb @@ -121,28 +121,28 @@ ## the stderr should contain "hello" Then "(the ){channel} should contain {string}" do |channel, expected| - combined_output = send("all_#{channel}") + combined_output = send(:"all_#{channel}") expect(combined_output).to include_output_string expected end ## the stderr should not contain "hello" Then "(the ){channel} should not contain {string}" do |channel, expected| - combined_output = send("all_#{channel}") + combined_output = send(:"all_#{channel}") expect(combined_output).not_to include_output_string expected end ## the stderr should contain exactly "hello" Then "(the ){channel} should contain exactly {string}" do |channel, expected| - combined_output = send("all_#{channel}") + combined_output = send(:"all_#{channel}") expect(combined_output).to output_string_eq expected end ## the stderr should not contain exactly "hello" Then "(the ){channel} should not contain exactly {string}" do |channel, expected| - combined_output = send("all_#{channel}") + combined_output = send(:"all_#{channel}") expect(combined_output).not_to output_string_eq expected end @@ -211,28 +211,28 @@ ## the stderr should contain: Then "(the ){channel} should contain:" do |channel, expected| - combined_output = send("all_#{channel}") + combined_output = send(:"all_#{channel}") expect(combined_output).to include_output_string(expected) end ## the stderr should not contain: Then "(the ){channel} should not contain:" do |channel, expected| - combined_output = send("all_#{channel}") + combined_output = send(:"all_#{channel}") expect(combined_output).not_to include_output_string(expected) end ## the stderr should contain exactly: Then "(the ){channel} should contain exactly:" do |channel, expected| - combined_output = send("all_#{channel}") + combined_output = send(:"all_#{channel}") expect(combined_output).to output_string_eq(expected) end ## the stderr should not contain exactly: Then "(the ){channel} should not contain exactly:" do |channel, expected| - combined_output = send("all_#{channel}") + combined_output = send(:"all_#{channel}") expect(combined_output).not_to output_string_eq(expected) end diff --git a/spec/support/shared_contexts/aruba.rb b/spec/support/shared_contexts/aruba.rb index 73416c447..d7889547b 100644 --- a/spec/support/shared_contexts/aruba.rb +++ b/spec/support/shared_contexts/aruba.rb @@ -22,7 +22,7 @@ def create_test_files(files, data = "a") include Aruba::Api def set_tag(tag_name, value) - instance_variable_set "@#{tag_name}", value + instance_variable_set :"@#{tag_name}", value end end