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

Update for rubocop 0.85

This commit is contained in:
Thomas Walpole 2020-06-01 11:34:52 -07:00
parent 6662816a5f
commit 384dc86db3
4 changed files with 11 additions and 5 deletions

View file

@ -21,6 +21,12 @@ Style/SlicingWithRange:
Enabled: true
Lint/DeprecatedOpenSSLConstant:
Enabled: true
Lint/MixedRegexpCaptureTypes:
Enabled: true
Style/RedundantRegexpCharacterClass:
Enabled: true
Style/RedundantRegexpEscape:
Enabled: true
Layout/LineLength:
Description: 'Limit lines to 80 characters.'

View file

@ -19,5 +19,5 @@ rescue StandardError, RSpec::Expectations::ExpectationNotMetError => e
end
Then(/^the failing exception should be nice$/) do
expect(@error_message).to match(/expected to find css \"h1#doesnotexist\"/)
expect(@error_message).to match(/expected to find css "h1#doesnotexist"/)
end

View file

@ -758,7 +758,7 @@ Capybara::SpecHelper.spec 'node' do
@session.visit('with_js')
@session.find(:css, '#click-test').click(x: 5, y: 5)
link = @session.find(:link, 'has-been-clicked')
locations = link.text.match(/^Has been clicked at (?<x>[\d\.-]+),(?<y>[\d\.-]+)$/)
locations = link.text.match(/^Has been clicked at (?<x>[\d.-]+),(?<y>[\d.-]+)$/)
# Resulting click location should be very close to 0, 0 relative to top left corner of the element, but may not be exact due to
# integer/float conversions and rounding.
expect(locations[:x].to_f).to be_within(1).of(5)
@ -884,7 +884,7 @@ Capybara::SpecHelper.spec 'node' do
@session.visit('with_js')
@session.find(:css, '#click-test').double_click(x: 10, y: 5)
link = @session.find(:link, 'has-been-double-clicked')
locations = link.text.match(/^Has been double clicked at (?<x>[\d\.-]+),(?<y>[\d\.-]+)$/)
locations = link.text.match(/^Has been double clicked at (?<x>[\d.-]+),(?<y>[\d.-]+)$/)
# Resulting click location should be very close to 10, 5 relative to top left corner of the element, but may not be exact due
# to integer/float conversions and rounding.
expect(locations[:x].to_f).to be_within(1).of(10)
@ -970,7 +970,7 @@ Capybara::SpecHelper.spec 'node' do
@session.visit('with_js')
@session.find(:css, '#click-test').right_click(x: 10, y: 10)
link = @session.find(:link, 'has-been-right-clicked')
locations = link.text.match(/^Has been right clicked at (?<x>[\d\.-]+),(?<y>[\d\.-]+)$/)
locations = link.text.match(/^Has been right clicked at (?<x>[\d.-]+),(?<y>[\d.-]+)$/)
# Resulting click location should be very close to 10, 10 relative to top left corner of the element, but may not be exact due
# to integer/float conversions and rounding
expect(locations[:x].to_f).to be_within(1).of(10)

View file

@ -606,7 +606,7 @@ RSpec.shared_examples Capybara::RSpecMatchers do |session, _mode|
visit('/with_js')
expect do
expect(session).to have_current_path('/not_with_js')
end.to raise_error(%r{to equal "/not\_with\_js"})
end.to raise_error(%r{to equal "/not_with_js"})
end
context 'with wait' do