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:
parent
7a437f76c6
commit
1cbacb6df8
3 changed files with 19 additions and 4 deletions
|
@ -1,5 +1,3 @@
|
|||
require 'test_helper'
|
||||
|
||||
class Hamlit::CommentTest < Haml::TestCase
|
||||
test 'renders html comment' do
|
||||
assert_render(<<-HAML, <<-HTML)
|
||||
|
|
17
test/hamlit/engine/doctype_test.rb
Normal file
17
test/hamlit/engine/doctype_test.rb
Normal 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
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue