').should == s(
:document,
- s(:p, nil, nil, s(:text, 'foo'))
+ s(:element, nil, 'p', nil, s(:text, 'foo'))
)
end
example 'parse an element with a single attribute' do
parse('').should == s(
:document,
- s(:p, nil, s(:attributes, s(:attribute, 'foo')), nil)
+ s(:element, nil, 'p', s(:attributes, s(:attribute, 'foo')), nil)
)
end
example 'parse an element with a single attribute with a value' do
parse('').should == s(
:document,
- s(:p, nil, s(:attributes, s(:attribute, 'foo', 'bar')), nil)
+ s(:element, nil, 'p', s(:attributes, s(:attribute, 'foo', 'bar')), nil)
)
end
@@ -31,8 +34,9 @@ describe Oga::Parser do
parse('').should == s(
:document,
s(
- :p,
+ :element,
nil,
+ 'p',
s(
:attributes,
s(:attribute, 'foo', 'bar'),
@@ -47,8 +51,9 @@ describe Oga::Parser do
parse('
Bar
').should == s(
:document,
s(
- :p,
+ :element,
nil,
+ 'p',
s(:attributes, s(:attribute, 'class', 'foo')),
s(:text, 'Bar')
)
@@ -58,7 +63,7 @@ describe Oga::Parser do
example 'parse an element with a namespace' do
parse('
').should == s(
:document,
- s(:p, 'foo', nil, nil)
+ s(:element, 'foo', 'p', nil, nil)
)
end
@@ -66,8 +71,9 @@ describe Oga::Parser do
parse('').should == s(
:document,
s(
- :p,
+ :element,
'foo',
+ 'p',
s(:attributes, s(:attribute, 'class', 'bar')),
nil
)
@@ -77,7 +83,7 @@ describe Oga::Parser do
example 'parse an element nested inside another element' do
parse('