From 351b5ac0040a804687f71173817b089925e14d0c Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 2 Mar 2015 16:20:06 +0100 Subject: [PATCH] Added spec for lexing inline HTML script tags. Related issue: #70 --- spec/oga/xml/lexer/html_script_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 spec/oga/xml/lexer/html_script_spec.rb diff --git a/spec/oga/xml/lexer/html_script_spec.rb b/spec/oga/xml/lexer/html_script_spec.rb new file mode 100644 index 0000000..54b1ccc --- /dev/null +++ b/spec/oga/xml/lexer/html_script_spec.rb @@ -0,0 +1,14 @@ +require 'spec_helper' + +describe Oga::XML::Lexer do + describe 'HTML script elements' do + it 'treats all contents of a script tag as plain text' do + lex('', :html => true).should == [ + [:T_ELEM_START, nil, 1], + [:T_ELEM_NAME, 'script', 1], + [:T_TEXT, 'foo