mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Fix tests
\n is escaped as 
 The error line number is on the first line Force error to occur on line 2
This commit is contained in:
parent
eff1161dc6
commit
f4f7812612
2 changed files with 6 additions and 6 deletions
|
@ -379,10 +379,10 @@ HAML
|
|||
end
|
||||
|
||||
def test_textareas
|
||||
assert_equal("<textarea>Foo\n bar\n baz</textarea>\n",
|
||||
assert_equal("<textarea>Foo
 bar
 baz</textarea>\n",
|
||||
render('%textarea= "Foo\n bar\n baz"'))
|
||||
|
||||
assert_equal("<pre>Foo\n bar\n baz</pre>\n",
|
||||
assert_equal("<pre>Foo
 bar
 baz</pre>\n",
|
||||
render('%pre= "Foo\n bar\n baz"'))
|
||||
|
||||
assert_equal("<textarea>#{'a' * 100}</textarea>\n",
|
||||
|
@ -951,7 +951,7 @@ HAML
|
|||
end
|
||||
|
||||
def test_ampersand_equals_should_escape_before_preserve
|
||||
assert_equal("<textarea>foo\nbar</textarea>\n", render('%textarea&= "foo\nbar"', :escape_html => false))
|
||||
assert_equal("<textarea>foo
bar</textarea>\n", render('%textarea&= "foo\nbar"', :escape_html => false))
|
||||
end
|
||||
|
||||
def test_bang_equals_should_not_escape
|
||||
|
@ -1434,7 +1434,7 @@ HAML
|
|||
end
|
||||
|
||||
def test_auto_preserve
|
||||
assert_equal("<pre>foo\nbar</pre>\n", render('%pre="foo\nbar"'))
|
||||
assert_equal("<pre>foo
bar</pre>\n", render('%pre="foo\nbar"'))
|
||||
assert_equal("<pre>foo\nbar</pre>\n", render("%pre\n foo\n bar"))
|
||||
end
|
||||
|
||||
|
|
|
@ -559,10 +559,10 @@ MESSAGE
|
|||
end
|
||||
|
||||
def test_error_return_line
|
||||
render("%p foo\n= haml_concat 'foo'\n%p bar")
|
||||
render("%p foo\n= haml_concat('foo').to_s\n%p bar")
|
||||
assert false, "Expected Haml::Error"
|
||||
rescue Haml::Error => e
|
||||
assert_equal 2, e.backtrace[1].scan(/:(\d+)/).first.first.to_i
|
||||
assert_equal 2, e.backtrace[0].scan(/:(\d+)/).first.first.to_i
|
||||
end
|
||||
|
||||
def test_error_return_line_in_helper
|
||||
|
|
Loading…
Add table
Reference in a new issue