From 145315c26aa59fc7e7387ddae9390b80c5f85898 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Wed, 3 Sep 2014 00:34:10 +0200 Subject: [PATCH] Spec for inline JS and CDATA tags. --- spec/oga/xml/lexer/inline_javascript_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/oga/xml/lexer/inline_javascript_spec.rb b/spec/oga/xml/lexer/inline_javascript_spec.rb index aa2ac9b..0aedbf5 100644 --- a/spec/oga/xml/lexer/inline_javascript_spec.rb +++ b/spec/oga/xml/lexer/inline_javascript_spec.rb @@ -24,5 +24,15 @@ describe Oga::XML::Lexer do [:T_ELEM_END, nil, 1] ] end + + example 'lex inline Javascript containing a CDATA tag' do + lex("").should == [ + [:T_ELEM_START, nil, 1], + [:T_ELEM_NAME, 'script', 1], + [:T_TEXT, @javascript, 1], + [:T_CDATA, 'foo', 1], + [:T_ELEM_END, nil, 1] + ] + end end end