mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Minor rubocop updates
This commit is contained in:
parent
e8f7189730
commit
54b0081dfd
5 changed files with 10 additions and 6 deletions
|
@ -239,7 +239,11 @@ Performance/Squeeze:
|
|||
Performance/StringInclude:
|
||||
Enabled: true
|
||||
|
||||
|
||||
Performance/MethodObjectAsBlock:
|
||||
Enabled: false
|
||||
|
||||
Performance/BlockGivenWithExplicitBlock:
|
||||
Enabled: false
|
||||
|
||||
RSpec/ExampleWording:
|
||||
Enabled: false
|
||||
|
|
|
@ -39,7 +39,7 @@ module Capybara
|
|||
alias index find_index
|
||||
|
||||
def each(&block)
|
||||
return enum_for(:each) unless block_given?
|
||||
return enum_for(:each) unless block
|
||||
|
||||
@result_cache.each(&block)
|
||||
loop do
|
||||
|
|
|
@ -11,7 +11,7 @@ module Capybara
|
|||
end
|
||||
|
||||
def within(*args, **kwargs, &block)
|
||||
if block_given?
|
||||
if block
|
||||
within_element(*args, **kwargs, &block)
|
||||
else
|
||||
be_within(*args)
|
||||
|
|
|
@ -178,7 +178,7 @@ module Capybara
|
|||
def_delegator :@filter_set, :describe
|
||||
|
||||
def describe_expression_filters(&block)
|
||||
if block_given?
|
||||
if block
|
||||
describe(:expression_filters, &block)
|
||||
else
|
||||
describe(:expression_filters) do |**options|
|
||||
|
|
|
@ -489,8 +489,8 @@ module Capybara
|
|||
# @raise [ArgumentError] if both or neither arguments were provided
|
||||
#
|
||||
def switch_to_window(window = nil, **options, &window_locator)
|
||||
raise ArgumentError, '`switch_to_window` can take either a block or a window, not both' if window && block_given?
|
||||
raise ArgumentError, '`switch_to_window`: either window or block should be provided' if !window && !block_given?
|
||||
raise ArgumentError, '`switch_to_window` can take either a block or a window, not both' if window && window_locator
|
||||
raise ArgumentError, '`switch_to_window`: either window or block should be provided' if !window && !window_locator
|
||||
|
||||
unless scopes.last.nil?
|
||||
raise Capybara::ScopeError, '`switch_to_window` is not supposed to be invoked from '\
|
||||
|
|
Loading…
Reference in a new issue