diff --git a/spec/oga/xml/lexer/html_closing_rules/caption_spec.rb b/spec/oga/xml/lexer/html_closing_rules/caption_spec.rb index e660dac..037cabf 100644 --- a/spec/oga/xml/lexer/html_closing_rules/caption_spec.rb +++ b/spec/oga/xml/lexer/html_closing_rules/caption_spec.rb @@ -1,8 +1,52 @@ require 'spec_helper' describe Oga::XML::Lexer do - describe 'HTML caption elements' do - it 'lexes an unclosed followed by another ' do + describe 'using HTML elements' do + it 'lexes an unclosed followed by a as separate elements' do + lex_html('foobar').should == [ + [:T_ELEM_NAME, 'caption', 1], + [:T_TEXT, 'foo', 1], + [:T_ELEM_END, nil, 1], + [:T_ELEM_NAME, 'thead', 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, 'caption', 1], + [:T_TEXT, 'foo', 1], + [:T_ELEM_END, nil, 1], + [:T_ELEM_NAME, 'tbody', 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, 'caption', 1], + [:T_TEXT, 'foo', 1], + [:T_ELEM_END, nil, 1], + [:T_ELEM_NAME, 'tfoot', 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, 'caption', 1], + [:T_TEXT, 'foo', 1], + [:T_ELEM_END, nil, 1], + [:T_ELEM_NAME, 'tr', 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, 'caption', 1], [:T_TEXT, 'foo', 1], @@ -13,7 +57,7 @@ describe Oga::XML::Lexer do ] end - it 'lexes an unclosed followed by a ' do + it 'lexes an unclosed followed by a as separate elements' do lex_html('foobar').should == [ [:T_ELEM_NAME, 'caption', 1], [:T_TEXT, 'foo', 1], @@ -23,5 +67,15 @@ describe Oga::XML::Lexer do [:T_ELEM_END, nil, 1] ] end + + it 'lexes an unclosed followed by a as separate elements' do + lex_html('foo').should == [ + [:T_ELEM_NAME, 'caption', 1], + [:T_TEXT, 'foo', 1], + [:T_ELEM_END, nil, 1], + [:T_ELEM_NAME, 'col', 1], + [:T_ELEM_END, nil, 1] + ] + end end end