Skip to content

Commit

Permalink
Gem updates
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed Nov 26, 2020
1 parent b6eef5e commit 2fd00e5
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 30 deletions.
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ Lint/EmptyBlock:
Exclude:
- 'lib/capybara/spec/**/*'
- 'spec/**/*.rb'


Lint/DuplicateBranch:
Enabled: false

Naming/PredicateName:
Exclude:
- '**/*/*matchers.rb'
Expand Down
4 changes: 2 additions & 2 deletions capybara.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency('nokogiri', ['~> 1.8'])
s.add_runtime_dependency('rack', ['>= 1.6.0'])
s.add_runtime_dependency('rack-test', ['>= 0.6.3'])
s.add_runtime_dependency('regexp_parser', ['~>1.5'])
s.add_runtime_dependency('regexp_parser', ['>=1.5', '<3.0'])
s.add_runtime_dependency('xpath', ['~>3.2'])

s.add_development_dependency('byebug') unless RUBY_PLATFORM == 'java'
Expand All @@ -46,7 +46,7 @@ Gem::Specification.new do |s|
s.add_development_dependency('rake')
s.add_development_dependency('rspec', ['>= 3.5.0'])
s.add_development_dependency('rspec-instafail')
s.add_development_dependency('rubocop', ['~>1.1.0'])
s.add_development_dependency('rubocop', ['~>1.1'])
s.add_development_dependency('rubocop-performance')
s.add_development_dependency('rubocop-rspec', ['~>2.0.0.pre'])
s.add_development_dependency('sauce_whisk')
Expand Down
12 changes: 6 additions & 6 deletions lib/capybara/node/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,19 @@ def synchronize(seconds = nil, errors: nil)

# @api private
def find_css(css, **options)
if base.method(:find_css).arity != 1
base.find_css(css, **options)
else
if base.method(:find_css).arity == 1
base.find_css(css)
else
base.find_css(css, **options)
end
end

# @api private
def find_xpath(xpath, **options)
if base.method(:find_xpath).arity != 1
base.find_xpath(xpath, **options)
else
if base.method(:find_xpath).arity == 1
base.find_xpath(xpath)
else
base.find_xpath(xpath, **options)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/node/matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def has_no_button?(locator = nil, **options, &optional_filter_block)
#
# page.has_field?('Email', type: 'email')
#
# Note: 'textarea' and 'select' are valid type values, matching the associated tag names.
# NOTE: 'textarea' and 'select' are valid type values, matching the associated tag names.
#
# @param [String] locator The label, name or id of a field to check for
# @option options [String, Regexp] :with The text content of the field or a Regexp to match
Expand Down
12 changes: 6 additions & 6 deletions lib/capybara/queries/selector_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,16 @@ def find_nodes_by_selector_format(node, exact)

case selector_format
when :css
if node.method(:find_css).arity != 1
node.find_css(css, **hints)
else
if node.method(:find_css).arity == 1
node.find_css(css)
else
node.find_css(css, **hints)
end
when :xpath
if node.method(:find_xpath).arity != 1
node.find_xpath(xpath(exact), **hints)
else
if node.method(:find_xpath).arity == 1
node.find_xpath(xpath(exact))
else
node.find_xpath(xpath(exact), **hints)
end
else
raise ArgumentError, "Unknown format: #{selector_format}"
Expand Down
6 changes: 3 additions & 3 deletions lib/capybara/result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def [](*args)
idx, length = args
max_idx = case idx
when Integer
if !idx.negative?
length.nil? ? idx : idx + length - 1
else
if idx.negative?
nil
else
length.nil? ? idx : idx + length - 1
end
when Range
# idx.max is broken with beginless ranges
Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/selector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
# * Filters:
# * :\<any> (String, Regexp) - Match on any specified element attribute
#
class Capybara::Selector; end
class Capybara::Selector; end # rubocop:disable Lint/EmptyClass

Capybara::Selector::FilterSet.add(:_field) do
node_filter(:checked, :boolean) { |node, value| !(value ^ node.checked?) }
Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/selector/definition/table_row.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
cell_xp = XPath.descendant(:td)[
XPath.string.n.is(cell) & XPath.position.equals(header_xp.preceding_sibling.count.plus(1))
]
xp[cell_xp]
xp.where(cell_xp)
end
else
initial_td = XPath.descendant(:td)[XPath.string.n.is(locator.shift)]
Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/selenium/atoms/src/isDisplayed.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
// the overflow style of the body, and the body is really overflow:visible.
var overflowElem = e;
if (htmlOverflowStyle == "visible") {
// Note: bodyElem will be null/undefined in SVG documents.
// NOTE: bodyElem will be null/undefined in SVG documents.
if (e == htmlElem && bodyElem) {
overflowElem = bodyElem;
} else if (e == bodyElem) {
Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/selenium/nodes/chrome_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def chromedriver_supports_displayed_endpoint?
end

def chromedriver_version
capabilities['chrome']['chromedriverVersion'].split(' ')[0]
capabilities['chrome']['chromedriverVersion'].split(' ')[0] # rubocop:disable Style/RedundantArgument
end

def native_displayed?
Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/spec/session/html_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
# NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
# because of the methods being tested. In tests using Capybara this type of behavior should be implemented
# using Capybara provided assertions with builtin waiting behavior.

Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/spec/session/node_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
# NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
# because of the methods being tested. In tests using Capybara this type of behavior should be implemented
# using Capybara provided assertions with builtin waiting behavior.

Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/spec/session/refresh_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
# NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
# because of the methods being tested. In tests using Capybara this type of behavior should be implemented
# using Capybara provided assertions with builtin waiting behavior.

Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/spec/session/window/switch_to_window_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
# NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
# because of the methods being tested. In tests using Capybara this type of behavior should be implemented
# using Capybara provided assertions with builtin waiting behavior.

Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/spec/session/window/window_opened_by_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
# NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
# because of the methods being tested. In tests using Capybara this type of behavior should be implemented
# using Capybara provided assertions with builtin waiting behavior.

Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/spec/session/window/window_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
# NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
# because of the methods being tested. In tests using Capybara this type of behavior should be implemented
# using Capybara provided assertions with builtin waiting behavior.

Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/spec/session/window/windows_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
# NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
# because of the methods being tested. In tests using Capybara this type of behavior should be implemented
# using Capybara provided assertions with builtin waiting behavior.

Expand Down
1 change: 1 addition & 0 deletions lib/capybara/spec/test_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

class TestApp < Sinatra::Base
class TestAppError < Exception; end # rubocop:disable Lint/InheritException

class TestAppOtherError < Exception # rubocop:disable Lint/InheritException
def initialize(string1, msg)
super()
Expand Down

0 comments on commit 2fd00e5

Please sign in to comment.