Sha256: 40a1d61b693107fe4fd5fc6411e24596bc28e5d49f0424e60e6ee42bff6756a2
Contents?: true
Size: 722 Bytes
Versions: 45
Compression:
Stored size: 722 Bytes
Contents
# frozen_string_literal: true require 'capybara/selector/filters/base' module Capybara class Selector module Filters class LocatorFilter < NodeFilter def initialize(block, **options) super(nil, nil, block, **options) end def matches?(node, value, context = nil, exact:) apply(node, value, true, context, exact: exact, format: context&.default_format) rescue Capybara::ElementNotFound false end private def apply(subject, value, skip_value, ctx, **options) return skip_value if skip?(value) filter_context(ctx).instance_exec(subject, value, **options, &@block) end end end end end
Version data entries
45 entries across 34 versions & 4 rubygems