Use separate spec files for each pseudo class.
This commit is contained in:
parent
03f897c2b7
commit
64f9c570fa
|
@ -1,19 +1,7 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Oga::CSS::Parser do
|
||||
context 'pseudo classes' do
|
||||
example 'parse the x:root pseudo class' do
|
||||
parse_css('x:root').should == parse_xpath(
|
||||
'descendant-or-self::x[not(parent::*)]'
|
||||
)
|
||||
end
|
||||
|
||||
example 'parse the :root pseudo class' do
|
||||
parse_css(':root').should == parse_xpath(
|
||||
'descendant-or-self::*[not(parent::*)]'
|
||||
)
|
||||
end
|
||||
|
||||
context ':nth-child pseudo class' do
|
||||
example 'parse the x:nth-child(1) pseudo class' do
|
||||
parse_css('x:nth-child(1)').should == parse_xpath(
|
||||
'descendant-or-self::x[count(preceding-sibling::*) = 0]'
|
|
@ -0,0 +1,17 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Oga::CSS::Parser do
|
||||
context ':root pseudo class' do
|
||||
example 'parse the x:root pseudo class' do
|
||||
parse_css('x:root').should == parse_xpath(
|
||||
'descendant-or-self::x[not(parent::*)]'
|
||||
)
|
||||
end
|
||||
|
||||
example 'parse the :root pseudo class' do
|
||||
parse_css(':root').should == parse_xpath(
|
||||
'descendant-or-self::*[not(parent::*)]'
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue