Sha256: c30404db4f78560bd1331ce8ed39b9cd7f20d8d670d8cf03478a02911dbad285

Contents?: true

Size: 896 Bytes

Versions: 19

Compression:

Stored size: 896 Bytes

Contents

# frozen_string_literal: true
require 'spec_helper'

RSpec.describe Capybara::Selector::FilterSet do
  after do
    Capybara::Selector::FilterSet.remove(:test)
  end

  it "allows node filters" do
    fs = Capybara::Selector::FilterSet.add(:test) do
      filter(:node_test, :boolean) { |node, value| true }
      expression_filter(:expression_test, :boolean) { |expr, value| true }
    end

    expect(fs.node_filters.keys).to include(:node_test)
    expect(fs.node_filters.keys).not_to include(:expression_test)
  end

  it "allows expression filters" do
    fs = Capybara::Selector::FilterSet.add(:test) do
      filter(:node_test, :boolean) { |node, value| true }
      expression_filter(:expression_test, :boolean) { |expr, value| true }
    end

    expect(fs.expression_filters.keys).to include(:expression_test)
    expect(fs.expression_filters.keys).not_to include(:node_test)
  end
end

Version data entries

19 entries across 17 versions & 2 rubygems

Version Path
tdiary-5.0.8 vendor/bundle/gems/capybara-2.18.0/spec/filter_set_spec.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/capybara-2.18.0/spec/filter_set_spec.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/capybara-2.16.1/spec/filter_set_spec.rb
capybara-2.18.0 spec/filter_set_spec.rb
capybara-2.17.0 spec/filter_set_spec.rb
tdiary-5.0.7 vendor/bundle/gems/capybara-2.16.1/spec/filter_set_spec.rb
capybara-2.16.1 spec/filter_set_spec.rb
capybara-2.16.0 spec/filter_set_spec.rb
capybara-2.15.4 spec/filter_set_spec.rb
capybara-2.15.3 spec/filter_set_spec.rb
capybara-2.15.2 spec/filter_set_spec.rb
tdiary-5.0.6 vendor/bundle/gems/capybara-2.15.1/spec/filter_set_spec.rb
capybara-2.15.1 spec/filter_set_spec.rb
capybara-2.15.0 spec/filter_set_spec.rb
tdiary-5.0.5 vendor/bundle/gems/capybara-2.14.3/spec/filter_set_spec.rb
capybara-2.14.4 spec/filter_set_spec.rb
capybara-2.14.3 spec/filter_set_spec.rb
capybara-2.14.2 spec/filter_set_spec.rb
capybara-2.14.1 spec/filter_set_spec.rb