From 2a1c5646f3ad5e3e8b64ec3f22bbf15f80e2fd23 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 18 May 2015 00:32:09 +0200 Subject: [PATCH] Reworked HTML colgroup closing specs --- .../lexer/html_closing_rules/colgroup_spec.rb | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/spec/oga/xml/lexer/html_closing_rules/colgroup_spec.rb b/spec/oga/xml/lexer/html_closing_rules/colgroup_spec.rb index 79837b5..cc0bf41 100644 --- a/spec/oga/xml/lexer/html_closing_rules/colgroup_spec.rb +++ b/spec/oga/xml/lexer/html_closing_rules/colgroup_spec.rb @@ -1,8 +1,8 @@ require 'spec_helper' describe Oga::XML::Lexer do - describe 'HTML colgroup elements' do - it 'lexes an unclosed followed by another ' do + describe 'using HTML elements' do + it 'lexes two unclosed elements as separate elements' do lex_html('foobar').should == [ [:T_ELEM_NAME, 'colgroup', 1], [:T_TEXT, 'foo', 1], @@ -12,5 +12,23 @@ describe Oga::XML::Lexer do [:T_ELEM_END, nil, 1] ] end + + it 'lexes a element following a as a child element' do + lex_html('').should == [ + [:T_ELEM_NAME, 'colgroup', 1], + [:T_ELEM_NAME, 'col', 1], + [:T_ELEM_END, nil, 1], + [:T_ELEM_END, nil, 1] + ] + end + + it 'lexes a