Expanded tests for XML::Document#inspect.
This commit is contained in:
parent
e9412c9c4e
commit
915d3ee505
|
@ -85,8 +85,9 @@ describe Oga::XML::Document do
|
||||||
context '#inspect' do
|
context '#inspect' do
|
||||||
before do
|
before do
|
||||||
@instance = described_class.new(
|
@instance = described_class.new(
|
||||||
:doctype => Oga::XML::Doctype.new(:name => 'html'),
|
:doctype => Oga::XML::Doctype.new(:name => 'html'),
|
||||||
:children => [Oga::XML::Comment.new(:text => 'foo')]
|
:xml_declaration => Oga::XML::XmlDeclaration.new,
|
||||||
|
:children => [Oga::XML::Comment.new(:text => 'foo')]
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -99,9 +100,24 @@ Document(
|
||||||
public_id: nil
|
public_id: nil
|
||||||
system_id: nil
|
system_id: nil
|
||||||
)
|
)
|
||||||
xml_declaration: nil
|
xml_declaration: XmlDeclaration(
|
||||||
|
version: "1.0"
|
||||||
|
encoding: "UTF-8"
|
||||||
|
standalone: nil
|
||||||
|
)
|
||||||
children: [
|
children: [
|
||||||
Comment(text: "foo")
|
Comment(text: "foo")
|
||||||
|
])
|
||||||
|
EOF
|
||||||
|
end
|
||||||
|
|
||||||
|
example 'pretty-print a document without a doctype and XML declaration' do
|
||||||
|
described_class.new.inspect.should == <<-EOF.strip
|
||||||
|
Document(
|
||||||
|
doctype: nil
|
||||||
|
xml_declaration: nil
|
||||||
|
children: [
|
||||||
|
|
||||||
])
|
])
|
||||||
EOF
|
EOF
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue