require 'helper'
describe Temple::HTML::Fast do
before do
@html = Temple::HTML::Fast.new
end
it 'should compile html doctype' do
@html.call([:multi, [:html, :doctype, '5']]).should.equal [:multi, [:static, '']]
@html.call([:multi, [:html, :doctype, 'html']]).should.equal [:multi, [:static, '']]
@html.call([:multi, [:html, :doctype, '1.1']]).should.equal [:multi,
[:static, '']]
end
it 'should compile xml encoding' do
@html.call([:html, :doctype, 'xml latin1']).should.equal [:static, ""]
end
it 'should compile html comment' do
@html.call([:html, :comment, [:static, 'test']]).should.equal [:multi, [:static, ""]]
end
it 'should compile autoclosed html tag' do
@html.call([:html, :tag,
'img', [:attrs],
[:multi, [:newline]]
]).should.equal [:multi,
[:static, ""],
[:multi, [:newline]]]
end
it 'should compile explicitly closed html tag' do
@html.call([:html, :tag,
'closed', [:attrs]
]).should.equal [:multi,
[:static, "