lib/wildcard_finders/finders.rb in wildcard_finders-0.2.0 vs lib/wildcard_finders/finders.rb in wildcard_finders-0.2.1

- old
+ new

@@ -21,17 +21,15 @@ WildcardMatchers.wildcard_match?(hash_from_element, matcher) else WildcardMatchers.wildcard_match?(element, block || matcher) end end - end - if results.empty? - raise Capybara::ElementNotFound, "no <#{tag}> to match #{matcher}" - else - # not compatible for capybara 2.0 - results.first + raise Capybara::ElementNotFound, "no <#{tag}> to match #{matcher}" if results.empty? end + + # not compatible for capybara 2.0 + results.first end end def find_exactly(tag, matcher) xpath = XPath.generate do |x|