Sha256: 543fa93a1e84a1cea0ef2e3851063a35162abf543c594d309850abb20f0182a0

Contents?: true

Size: 456 Bytes

Versions: 7

Compression:

Stored size: 456 Bytes

Contents

require 'spec_helper'

describe Hexp::CssSelector::CommaSequence do
  let(:comma_sequence) { Hexp::CssSelector::Parser.call(selector) }

  it 'has members' do
    described_class.new([:foo]).members == [:foo]
  end

  describe '#matches?' do
    context do
      let(:selector) { 'ul li, li' }
      let(:element)  { H[:li, class: 'baz'] }

      it 'should match' do
        expect(comma_sequence.matches?(element)).to be true
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hexp-0.4.6 spec/unit/hexp/css_selector/comma_sequence_spec.rb
hexp-0.4.5 spec/unit/hexp/css_selector/comma_sequence_spec.rb
hexp-0.4.4 spec/unit/hexp/css_selector/comma_sequence_spec.rb
hexp-0.4.3 spec/unit/hexp/css_selector/comma_sequence_spec.rb
hexp-0.4.2 spec/unit/hexp/css_selector/comma_sequence_spec.rb
hexp-0.4.1 spec/unit/hexp/css_selector/comma_sequence_spec.rb
hexp-0.4.0.beta1 spec/unit/hexp/css_selector/comma_sequence_spec.rb