Failing spec for lexing inline Javascript.

This commit is contained in:
Yorick Peterse 2014-09-02 22:50:36 +02:00
parent 96b7296910
commit 07617a9c47
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
require 'spec_helper'
describe Oga::XML::Lexer do
context 'lexing inline Javascript' do
before do
@javascript = <<-EOF.strip
(function()
{
if ( some_number < 10 )
{
console.log('Hello');
}
})();
EOF
end
example 'lex inline Javascript' do
lex("<script>\n#{@javascript}\n</script>").should == [
[:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'script', 1],
[:T_TEXT, "\n#{@javascript}\n", 1],
[:T_ELEM_END, nil, 9]
]
end
end
end