diff --git a/spec/oga/xml/lexer/html_closing_rules/head_spec.rb b/spec/oga/xml/lexer/html_closing_rules/head_spec.rb new file mode 100644 index 0000000..583f696 --- /dev/null +++ b/spec/oga/xml/lexer/html_closing_rules/head_spec.rb @@ -0,0 +1,37 @@ +require 'spec_helper' + +describe Oga::XML::Lexer do + describe 'using HTML
elements' do + it 'lexes an unclosed followed by a as separate elements' do + lex_html('foobar').should == [ + [:T_ELEM_NAME, 'head', 1], + [:T_TEXT, 'foo', 1], + [:T_ELEM_END, nil, 1], + [:T_ELEM_NAME, 'head', 1], + [:T_TEXT, 'bar', 1], + [:T_ELEM_END, nil, 1] + ] + end + + it 'lexes an unclosed followed by a as separate elements' do + lex_html('foobar').should == [ + [:T_ELEM_NAME, 'head', 1], + [:T_TEXT, 'foo', 1], + [:T_ELEM_END, nil, 1], + [:T_ELEM_NAME, 'body', 1], + [:T_TEXT, 'bar', 1], + [:T_ELEM_END, nil, 1] + ] + end + + it 'lexes a