Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use options hash from query object

  • Loading branch information...
commit 5ae5fb0b773ef067905352f51b98829868b2d681 1 parent 850292f
tmertens authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/capybara/node/matchers.rb
View
12 lib/capybara/node/matchers.rb
@@ -89,10 +89,10 @@ def has_no_selector?(*args)
# @raise [Capybara::ExpectationNotMet] If the selector does not exist
#
def assert_selector(*args)
- options = args.last.is_a?(Hash) ? args.last.dup : {}
- synchronize(Capybara::Query.new(*args).wait) do
+ query = Capybara::Query.new(*args)
+ synchronize(query.wait) do
result = all(*args)
- raise Capybara::ExpectationNotMet, result.failure_message if result.size == 0 && !Capybara::Helpers.expects_none?(options)
+ raise Capybara::ExpectationNotMet, result.failure_message if result.size == 0 && !Capybara::Helpers.expects_none?(query.options)
end
return true
end
@@ -114,14 +114,14 @@ def assert_selector(*args)
# @raise [Capybara::ExpectationNotMet] If the selector exists
#
def assert_no_selector(*args)
- options = args.last.is_a?(Hash) ? args.last.dup : {}
- synchronize(Capybara::Query.new(*args).wait) do
+ query = Capybara::Query.new(*args)
+ synchronize(query.wait) do
begin
result = all(*args)
rescue Capybara::ExpectationNotMet => e
return true
else
- if result.size > 0 || (result.size == 0 && Capybara::Helpers.expects_none?(options))
+ if result.size > 0 || (result.size == 0 && Capybara::Helpers.expects_none?(query.options))
raise(Capybara::ExpectationNotMet, result.negative_failure_message)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.