mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Minor rubocop changes [ci skip]
This commit is contained in:
parent
bdaed0bada
commit
320ee96bb8
9 changed files with 12 additions and 11 deletions
|
@ -126,6 +126,9 @@ Layout/CaseIndentation:
|
|||
Layout/IndentFirstArrayElement:
|
||||
EnforcedStyle: consistent
|
||||
|
||||
Layout/IndentationWidth:
|
||||
IgnoredPatterns: ['^\s*module']
|
||||
|
||||
Security/YAMLLoad:
|
||||
Exclude:
|
||||
- 'lib/capybara/spec/**/*'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
module Capybara
|
||||
# @api private
|
||||
module Helpers
|
||||
module_function # rubocop:disable Layout/IndentationWidth
|
||||
module_function
|
||||
|
||||
##
|
||||
# @deprecated
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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|
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue