1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Passing doctype spec

This commit is contained in:
Takashi Kokubun 2015-10-24 20:52:15 +09:00
parent 7a437f76c6
commit 1cbacb6df8
3 changed files with 19 additions and 4 deletions

View file

@ -1,5 +1,3 @@
require 'test_helper'
class Hamlit::CommentTest < Haml::TestCase
test 'renders html comment' do
assert_render(<<-HAML, <<-HTML)

View file

@ -0,0 +1,17 @@
class Hamlit::DoctypeTest < Haml::TestCase
test 'renders html5 doctype' do
assert_render(<<-HAML, <<-HTML)
!!!
HAML
<!DOCTYPE html>
HTML
end
test 'renders xml doctype' do
assert_render(<<-HAML, <<-HTML, format: :xhtml)
!!! XML
HAML
<?xml version='1.0' encoding='utf-8' ?>
HTML
end
end

View file

@ -25,9 +25,9 @@ module Declarative
end
module HamlitTest
def assert_render(haml, html)
def assert_render(haml, html, options = {})
options = { escape_html: true, ugly: true}.merge(options)
haml, html = haml.unindent, html.unindent
options = { escape_html: true, ugly: true }
assert_equal render(haml, options), html
end
end