mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Minor Rubocop config cleanup
This commit is contained in:
parent
d76728fe95
commit
6ccad2a8f9
2 changed files with 37 additions and 32 deletions
53
.rubocop.yml
53
.rubocop.yml
|
@ -11,32 +11,12 @@ AllCops:
|
|||
|
||||
#################### Lint ################################
|
||||
|
||||
Layout/SpaceAroundMethodCallOperator:
|
||||
Enabled: true
|
||||
Style/ExponentialNotation:
|
||||
Enabled: true
|
||||
Layout/EmptyLinesAroundAttributeAccessor:
|
||||
Enabled: true
|
||||
Style/SlicingWithRange:
|
||||
Enabled: true
|
||||
Lint/DeprecatedOpenSSLConstant:
|
||||
Enabled: true
|
||||
Lint/MixedRegexpCaptureTypes:
|
||||
Enabled: true
|
||||
Style/RedundantRegexpCharacterClass:
|
||||
Enabled: true
|
||||
Style/RedundantRegexpEscape:
|
||||
Enabled: true
|
||||
Style/RedundantFetchBlock:
|
||||
Enabled: true
|
||||
|
||||
Layout/LineLength:
|
||||
Description: 'Limit lines to 80 characters.'
|
||||
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
|
||||
Exclude:
|
||||
- 'spec/**/*'
|
||||
- 'lib/capybara/spec/**/*'
|
||||
- 'lib/capybara/selector.rb'
|
||||
IgnoredPatterns:
|
||||
- '\s+# _?rubocop'
|
||||
- '^\s*#'
|
||||
|
@ -87,6 +67,12 @@ Lint/RaiseException:
|
|||
Lint/StructNewOverride:
|
||||
Enabled: true
|
||||
|
||||
Lint/DeprecatedOpenSSLConstant:
|
||||
Enabled: true
|
||||
|
||||
Lint/MixedRegexpCaptureTypes:
|
||||
Enabled: true
|
||||
|
||||
Layout/EndAlignment:
|
||||
EnforcedStyleAlignWith: variable
|
||||
|
||||
|
@ -149,6 +135,21 @@ Style/HashTransformKeys:
|
|||
Style/HashTransformValues:
|
||||
Enabled: true
|
||||
|
||||
Style/ExponentialNotation:
|
||||
Enabled: true
|
||||
|
||||
Style/SlicingWithRange:
|
||||
Enabled: true
|
||||
|
||||
Style/RedundantRegexpCharacterClass:
|
||||
Enabled: true
|
||||
|
||||
Style/RedundantRegexpEscape:
|
||||
Enabled: true
|
||||
|
||||
Style/RedundantFetchBlock:
|
||||
Enabled: true
|
||||
|
||||
Layout/EmptyLineBetweenDefs:
|
||||
AllowAdjacentOneLineDefs: true
|
||||
|
||||
|
@ -164,6 +165,12 @@ Layout/FirstArrayElementIndentation:
|
|||
Layout/IndentationWidth:
|
||||
IgnoredPatterns: ['^\s*module']
|
||||
|
||||
Layout/SpaceAroundMethodCallOperator:
|
||||
Enabled: true
|
||||
|
||||
Layout/EmptyLinesAroundAttributeAccessor:
|
||||
Enabled: true
|
||||
|
||||
Security/YAMLLoad:
|
||||
Exclude:
|
||||
- 'lib/capybara/spec/**/*'
|
||||
|
@ -194,10 +201,8 @@ RSpec/FilePath:
|
|||
Enabled: false
|
||||
|
||||
RSpec/PredicateMatcher:
|
||||
Enabled: false
|
||||
|
||||
# RSpec/InstanceVariable:
|
||||
# Enabled: false
|
||||
Exclude:
|
||||
- 'spec/basic_node_spec.rb'
|
||||
|
||||
Capybara/FeatureMethods:
|
||||
Enabled: false
|
||||
|
|
|
@ -129,25 +129,25 @@ RSpec.describe Capybara do
|
|||
|
||||
describe '#has_title?' do
|
||||
it 'returns whether the page has the given title' do
|
||||
expect(string.has_title?('simple_node')).to be_truthy
|
||||
expect(string.has_title?('monkey')).to be_falsey
|
||||
expect(string.has_title?('simple_node')).to be true
|
||||
expect(string.has_title?('monkey')).to be false
|
||||
end
|
||||
|
||||
it 'allows regexp matches' do
|
||||
expect(string.has_title?(/s[a-z]+_node/)).to be_truthy
|
||||
expect(string.has_title?(/monkey/)).to be_falsey
|
||||
expect(string.has_title?(/s[a-z]+_node/)).to be true
|
||||
expect(string.has_title?(/monkey/)).to be false
|
||||
end
|
||||
end
|
||||
|
||||
describe '#has_no_title?' do
|
||||
it 'returns whether the page does not have the given title' do
|
||||
expect(string.has_no_title?('simple_node')).to be_falsey
|
||||
expect(string.has_no_title?('monkey')).to be_truthy
|
||||
expect(string.has_no_title?('simple_node')).to be false
|
||||
expect(string.has_no_title?('monkey')).to be true
|
||||
end
|
||||
|
||||
it 'allows regexp matches' do
|
||||
expect(string.has_no_title?(/s[a-z]+_node/)).to be_falsey
|
||||
expect(string.has_no_title?(/monkey/)).to be_truthy
|
||||
expect(string.has_no_title?(/s[a-z]+_node/)).to be false
|
||||
expect(string.has_no_title?(/monkey/)).to be true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue