1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

rubocop config cleanup

This commit is contained in:
Thomas Walpole 2021-03-27 12:47:06 -07:00
parent 9ca027a14a
commit b6752b1259
6 changed files with 8 additions and 119 deletions

View file

@ -64,24 +64,6 @@ Lint/UnusedMethodArgument:
- 'lib/capybara/driver/base.rb'
- 'lib/capybara/driver/node.rb'
Lint/RedundantSafeNavigation:
Enabled: false
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Lint/DeprecatedOpenSSLConstant:
Enabled: true
Lint/MixedRegexpCaptureTypes:
Enabled: true
Lint/DuplicateElsifCondition:
Enabled: true
Layout/EndAlignment:
EnforcedStyleAlignWith: variable
@ -90,9 +72,6 @@ Lint/EmptyBlock:
- 'lib/capybara/spec/**/*'
- 'spec/**/*.rb'
Lint/DuplicateBranch:
Enabled: false
Naming/PredicateName:
Exclude:
- '**/*/*matchers.rb'
@ -124,9 +103,6 @@ Style/Documentation:
Style/DocumentDynamicEvalDefinition:
Enabled: false
Style/DoubleNegation:
Enabled: false
Style/EmptyElse:
EnforcedStyle: empty
@ -146,54 +122,9 @@ Style/IfUnlessModifier:
Exclude:
- 'spec/**/*'
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Style/ExponentialNotation:
Enabled: true
Style/SlicingWithRange:
Enabled: true
Style/RedundantRegexpCharacterClass:
Enabled: true
Style/RedundantRegexpEscape:
Enabled: true
Style/RedundantFetchBlock:
Enabled: true
Style/AccessorGrouping:
Enabled: false
Style/BisectedAttrAccessor:
Enabled: false
Style/RedundantAssignment:
Enabled: true
Style/ArrayCoercion:
Enabled: true
Style/CaseLikeIf:
Enabled: true
Style/HashAsLastArrayItem:
Enabled: true
Style/HashLikeCase:
Enabled: true
Style/RedundantFileExtensionInRequire:
Enabled: true
Layout/EmptyLineBetweenDefs:
AllowAdjacentOneLineDefs: true
@ -209,47 +140,14 @@ Layout/FirstArrayElementIndentation:
Layout/IndentationWidth:
IgnoredPatterns: ['^\s*module']
Layout/SpaceAroundMethodCallOperator:
Enabled: true
Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true
Security/YAMLLoad:
Exclude:
- 'lib/capybara/spec/**/*'
- 'spec/**/*'
Performance/AncestorsInclude:
Enabled: true
Performance/BigDecimalWithNumericArgument:
Enabled: true
Performance/RedundantSortBlock:
Enabled: true
Performance/RedundantStringChars:
Enabled: true
Performance/ReverseFirst:
Enabled: true
Performance/SortReverse:
Enabled: true
Performance/Squeeze:
Enabled: true
Performance/StringInclude:
Enabled: true
Performance/MethodObjectAsBlock:
Enabled: false
Performance/BlockGivenWithExplicitBlock:
Enabled: false
RSpec/ExampleWording:
Enabled: false
@ -278,11 +176,5 @@ RSpec/PredicateMatcher:
Exclude:
- 'spec/basic_node_spec.rb'
RSpec/Capybara:
Enabled: false
RSpec/Capybara/FeatureMethods:
Enabled: false
RSpec/Capybara/VisibilityMatcher:
Enabled: false

View file

@ -10,7 +10,7 @@ module Capybara
OPTIONS = %i[app reuse_server threadsafe server default_driver javascript_driver allow_gumbo].freeze
attr_accessor :app, :allow_gumbo
attr_reader :reuse_server, :threadsafe, :session_options
attr_reader :reuse_server, :threadsafe, :session_options # rubocop:disable Style/BisectedAttrAccessor
attr_writer :default_driver, :javascript_driver
SessionConfig::OPTIONS.each do |method|
@ -22,7 +22,7 @@ module Capybara
@javascript_driver = nil
end
attr_writer :reuse_server
attr_writer :reuse_server # rubocop:disable Style/BisectedAttrAccessor
def threadsafe=(bool)
if (bool != threadsafe) && Session.instance_created?

View file

@ -166,7 +166,7 @@ protected
end.join || ''
text = "\n#{text}\n" if BLOCK_ELEMENTS.include?(tag_name)
text
else
else # rubocop:disable Lint/DuplicateBranch
''
end
end

View file

@ -298,7 +298,7 @@ private
scroll_if_needed do
action_with_modifiers(click_options) do |action|
if block_given?
if block
yield action
else
click_options.coords? ? action.click : action.click(native)

View file

@ -840,10 +840,10 @@ RSpec.shared_examples Capybara::RSpecMatchers do |session, _mode|
end
it 'gives proper description when :visible option passed' do
expect(have_table('Lovely table', visible: true).description).to eq('have visible table "Lovely table"')
expect(have_table('Lovely table', visible: true).description).to eq('have visible table "Lovely table"') # rubocop:disable RSpec/Capybara/VisibilityMatcher
expect(have_table('Lovely table', visible: :hidden).description).to eq('have non-visible table "Lovely table"')
expect(have_table('Lovely table', visible: :all).description).to eq('have table "Lovely table"')
expect(have_table('Lovely table', visible: false).description).to eq('have table "Lovely table"')
expect(have_table('Lovely table', visible: false).description).to eq('have table "Lovely table"') # rubocop:disable RSpec/Capybara/VisibilityMatcher
end
it 'passes if there is such a table' do

View file

@ -71,13 +71,10 @@ Capybara::SpecHelper.run_specs TestSessions::SeleniumIE, 'selenium', capybara_sk
pending "IE 11 doesn't support date input types"
when /#click_link_or_button with :disabled option happily clicks on links which incorrectly have the disabled attribute$/
skip 'IE 11 obeys non-standard disabled attribute on anchor tag'
when /#right_click should allow modifiers$/
skip "Windows can't :meta click because :meta triggers start menu"
when /#click should allow modifiers$/
when /#click should allow modifiers$/, /#double_click should allow modifiers$/
pending "Doesn't work with IE for some unknown reason$"
when /#double_click should allow modifiers$/
pending "Doesn't work with IE for some unknown reason$"
when /#click should allow multiple modifiers$/
when /#click should allow multiple modifiers$/, /#right_click should allow modifiers$/
skip "Windows can't :meta click because :meta triggers start menu"
when /#double_click should allow multiple modifiers$/
skip "Windows can't :alt double click due to being properties shortcut"