We've already passed comment spec
This commit is contained in:
parent
21a4816464
commit
7a437f76c6
|
@ -8,4 +8,49 @@ class Hamlit::CommentTest < Haml::TestCase
|
|||
<!-- comments -->
|
||||
HTML
|
||||
end
|
||||
|
||||
test 'strips html comment ignoring around spcaes' do
|
||||
assert_render('/ comments ', <<-HTML)
|
||||
<!-- comments -->
|
||||
HTML
|
||||
end
|
||||
|
||||
test 'accepts backslash-only line in a comment' do
|
||||
assert_render(<<-'HAML', <<-HTML)
|
||||
/
|
||||
\
|
||||
HAML
|
||||
<!--
|
||||
|
||||
-->
|
||||
HTML
|
||||
end
|
||||
|
||||
test 'renders a deeply indented comment starting with backslash' do
|
||||
assert_render(<<-'HAML', <<-HTML)
|
||||
/
|
||||
\ a
|
||||
/
|
||||
a
|
||||
HAML
|
||||
<!--
|
||||
a
|
||||
-->
|
||||
<!--
|
||||
a
|
||||
-->
|
||||
HTML
|
||||
end
|
||||
|
||||
test 'ignores multiline comment' do
|
||||
assert_render(<<-'HAML', <<-HTML)
|
||||
-# if true
|
||||
- raise 'ng'
|
||||
= invalid script
|
||||
too deep indent
|
||||
ok
|
||||
HAML
|
||||
ok
|
||||
HTML
|
||||
end
|
||||
end
|
||||
|
|
|
@ -27,7 +27,8 @@ end
|
|||
module HamlitTest
|
||||
def assert_render(haml, html)
|
||||
haml, html = haml.unindent, html.unindent
|
||||
assert_equal render(haml), html
|
||||
options = { escape_html: true, ugly: true }
|
||||
assert_equal render(haml, options), html
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue