lib/capybara/selector.rb in capybara-3.2.1 vs lib/capybara/selector.rb in capybara-3.3.0

- old
+ new

@@ -110,9 +110,18 @@ node_filter(:href) do |node, href| # If not a Regexp it's been handled in the main XPath href.is_a?(Regexp) ? node[:href].match(href) : true end + expression_filter(:download, valid_values: [true, false, String]) do |expr, download| + mod = case download + when true then XPath.attr(:download) + when false then !XPath.attr(:download) + when String then XPath.attr(:download) == download + end + expr[mod] + end + describe do |**options| desc = +"" desc << " with href #{options[:href].inspect}" if options[:href] desc << " with no href attribute" if options.fetch(:href, true).nil? end