diff --git a/spec/oga/parser/doctype_spec.rb b/spec/oga/parser/doctype_spec.rb new file mode 100644 index 0000000..58072ad --- /dev/null +++ b/spec/oga/parser/doctype_spec.rb @@ -0,0 +1,37 @@ +require 'spec_helper' + +describe Oga::Parser do + context 'doctypes' do + example 'parse a doctype' do + parse_html('').should == s(:document, s(:doctype)) + end + + example 'parse a doctype with a public ID' do + parse_html('').should == s( + :document, + s(:doctype, 'foo') + ) + end + + example 'parse a doctype with a public and private ID' do + parse_html('').should == s( + :document, + s(:doctype, 'foo', 'bar') + ) + end + + example 'parse an HTML 4 strict doctype' do + doctype = '' + + parse_html(doctype).should == s( + :document, + s( + :doctype, + '-//W3C//DTD HTML 4.01//EN', + 'http://www.w3.org/TR/html4/strict.dtd' + ) + ) + end + end +end diff --git a/spec/oga/parser/html/doctype_spec.rb b/spec/oga/parser/html/doctype_spec.rb deleted file mode 100644 index be85d22..0000000 --- a/spec/oga/parser/html/doctype_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'spec_helper' - -describe Oga::Parser::HTML do - context 'doctypes' do - example 'parse the HTML5 doctype' do - doctype = '' - - parse_html(doctype).should == s( :document, s(:doctype, doctype)) - end - - example 'parse an HTML 4 strict doctype' do - doctype = '' - - parse_html(doctype).should == s(:document, s(:doctype, doctype)) - end - end -end