Sha256: 76264db2df8810d28a560719118d45333e49ef18d4be96123c9d80b448d12d75
Contents?: true
Size: 782 Bytes
Versions: 82
Compression:
Stored size: 782 Bytes
Contents
# frozen_string_literal: true require 'capybara/selector/filters/base' module Capybara class Selector module Filters class NodeFilter < Base def initialize(name, matcher, block, **options) super @block = if boolean? proc do |node, value| error_cnt = errors.size block.call(node, value).tap do |res| add_error("Expected #{name} #{value} but it wasn't") if !res && error_cnt == errors.size end end else block end end def matches?(node, name, value, context = nil) apply(node, name, value, true, context) rescue Capybara::ElementNotFound false end end end end end
Version data entries
82 entries across 69 versions & 6 rubygems