Minor rubocop changes [ci skip]

This commit is contained in:
Thomas Walpole 2019-05-30 15:07:27 -07:00
parent bdaed0bada
commit 320ee96bb8
9 changed files with 12 additions and 11 deletions

View File

@ -126,6 +126,9 @@ Layout/CaseIndentation:
Layout/IndentFirstArrayElement:
EnforcedStyle: consistent
Layout/IndentationWidth:
IgnoredPatterns: ['^\s*module']
Security/YAMLLoad:
Exclude:
- 'lib/capybara/spec/**/*'

View File

@ -3,7 +3,7 @@
module Capybara
# @api private
module Helpers
module_function # rubocop:disable Layout/IndentationWidth
module_function
##
# @deprecated

View File

@ -305,12 +305,12 @@ module Capybara
synchronize(Capybara::Queries::BaseQuery.wait(options, session_options.default_max_wait_time)) do
begin
find(:select, from, options)
rescue Capybara::ElementNotFound => select_error # _rubocop:disable Naming/RescuedExceptionsVariableName
rescue Capybara::ElementNotFound => select_error
raise if %i[selected with_selected multiple].any? { |option| options.key?(option) }
begin
find(:datalist_input, from, options)
rescue Capybara::ElementNotFound => dlinput_error # _rubocop:disable Naming/RescuedExceptionsVariableName
rescue Capybara::ElementNotFound => dlinput_error
raise Capybara::ElementNotFound, "#{select_error.message} and #{dlinput_error.message}"
end
end

View File

@ -89,7 +89,7 @@ module Capybara
matches_system_filters?(node) &&
matches_node_filters?(node, node_filter_errors) &&
matches_filter_block?(node)
rescue *(node.respond_to?(:session) ? node.session.driver.invalid_element_errors : []) # _rubocop:disable Naming/RescuedExceptionsVariableName
rescue *(node.respond_to?(:session) ? node.session.driver.invalid_element_errors : [])
false
end

View File

@ -4,7 +4,7 @@ class Capybara::Selenium::Node
module Html5Drag
# Implement methods to emulate HTML5 drag and drop
private # rubocop:disable Layout/IndentationWidth
private
def html5_drag_to(element)
driver.execute_script MOUSEDOWN_TRACKER

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
module CapybaraAtoms
private # rubocop:disable Layout/IndentationWidth
private
def read_atom(function)
@atoms ||= Hash.new do |hash, key|

View File

@ -12,7 +12,7 @@ module Capybara
def request(&block)
ssl? ? https_request(&block) : http_request(&block)
rescue *TRY_HTTPS_ERRORS # _rubocop:disable Naming/RescuedExceptionsVariableName
rescue *TRY_HTTPS_ERRORS
res = https_request(&block)
@ssl = true
res

View File

@ -736,9 +736,7 @@ module Capybara
# @param [Hash] options a customizable set of options
#
def save_and_open_screenshot(path = nil, **options)
# rubocop:disable Lint/Debugger
save_screenshot(path, options).tap { |s_path| open_file(s_path) }
# rubocop:enable Lint/Debugger
save_screenshot(path, options).tap { |s_path| open_file(s_path) } # rubocop:disable Lint/Debugger
end
def document

View File

@ -49,7 +49,7 @@ module Capybara
# @return [Boolean] whether this window is the window in which commands are being executed
def current?
@driver.current_window_handle == @handle
rescue @driver.no_such_window_error # _rubocop:disable Naming/RescuedExceptionsVariableName
rescue @driver.no_such_window_error
false
end