From 7efced6e73c38edd9e38b6690debf0ab4c45600f Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Sun, 14 Mar 2021 14:59:48 -0700 Subject: [PATCH] Rubocop updates --- lib/capybara/node/simple.rb | 1 + lib/capybara/registrations/drivers.rb | 6 +++--- lib/capybara/selector/filters/base.rb | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/capybara/node/simple.rb b/lib/capybara/node/simple.rb index bb27f092..9ba05881 100644 --- a/lib/capybara/node/simple.rb +++ b/lib/capybara/node/simple.rb @@ -194,6 +194,7 @@ module Capybara def ==(other) native == other.native end + private def option_value(option) diff --git a/lib/capybara/registrations/drivers.rb b/lib/capybara/registrations/drivers.rb index 18667aae..8dd07119 100644 --- a/lib/capybara/registrations/drivers.rb +++ b/lib/capybara/registrations/drivers.rb @@ -14,7 +14,7 @@ Capybara.register_driver :selenium_headless do |app| browser_options = ::Selenium::WebDriver::Firefox::Options.new.tap do |opts| opts.add_argument '-headless' end - Capybara::Selenium::Driver.new(app, **Hash[:browser => :firefox, options_key => browser_options]) + Capybara::Selenium::Driver.new(app, **{ :browser => :firefox, options_key => browser_options }) end Capybara.register_driver :selenium_chrome do |app| @@ -25,7 +25,7 @@ Capybara.register_driver :selenium_chrome do |app| opts.add_argument('--disable-site-isolation-trials') end - Capybara::Selenium::Driver.new(app, **Hash[:browser => :chrome, options_key => browser_options]) + Capybara::Selenium::Driver.new(app, **{ :browser => :chrome, options_key => browser_options }) end Capybara.register_driver :selenium_chrome_headless do |app| @@ -38,5 +38,5 @@ Capybara.register_driver :selenium_chrome_headless do |app| opts.add_argument('--disable-site-isolation-trials') end - Capybara::Selenium::Driver.new(app, **Hash[:browser => :chrome, options_key => browser_options]) + Capybara::Selenium::Driver.new(app, **{ :browser => :chrome, options_key => browser_options }) end diff --git a/lib/capybara/selector/filters/base.rb b/lib/capybara/selector/filters/base.rb index 94664a4e..c65e0140 100644 --- a/lib/capybara/selector/filters/base.rb +++ b/lib/capybara/selector/filters/base.rb @@ -69,7 +69,7 @@ module Capybara def valid_value?(value) return true unless @options.key?(:valid_values) - Array(@options[:valid_values]).any? { |valid| valid === value } # rubocop:disable Style/CaseEquality + Array(@options[:valid_values]).any? { |valid| valid === value } # rubocop:disable Style/CaseEquality,Performance/RedundantEqualityComparisonBlock end end end