mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
remove redundant begin/end
This commit is contained in:
parent
b01a2ce417
commit
f07af14d3a
2 changed files with 4 additions and 6 deletions
|
@ -7,11 +7,9 @@ module Capybara
|
|||
module Filters
|
||||
class NodeFilter < Base
|
||||
def matches?(node, name, value)
|
||||
begin
|
||||
apply(node, name, value, true)
|
||||
rescue Capybara::ElementNotFound
|
||||
false
|
||||
end
|
||||
apply(node, name, value, true)
|
||||
rescue Capybara::ElementNotFound
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -128,7 +128,7 @@ Capybara::SpecHelper.spec '#find' do
|
|||
Capybara.add_selector(:beatle) do
|
||||
xpath { |name| ".//li[contains(@class, 'beatle')][contains(text(), '#{name}')]" }
|
||||
node_filter(:type) { |node, type| node[:class].split(/\s+/).include?(type) }
|
||||
node_filter(:fail) { |node, val| raise Capybara::ElementNotFound, 'fail' }
|
||||
node_filter(:fail) { |_node, _val| raise Capybara::ElementNotFound, 'fail' }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue