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