Broken warnings implementation.

This commit is contained in:
Tristan Hume
2013-08-22 12:12:35 -04:00
parent 14a17520de
commit 93fcd5687c
4 changed files with 30 additions and 3 deletions
+3 -3
View File
@@ -92,10 +92,10 @@ class ErrorHandlingTest < Test::Unit::TestCase
end
def test_warnings
template = Liquid::Template.parse('{% if ~~~ %}derp{% else %}wat{% endif %}', :error_mode => :warn)
template = Liquid::Template.parse('{% if ~~~ %}{{%%%}}{% else %}wat{% endif %}', :error_mode => :warn)
assert_equal 2, template.warnings.size
assert_equal 'Unexpected character ~ in "~~~"', template.warnings.first.message
assert_equal 'wat', template.render
assert_equal 1, template.errors.size
assert_equal 'Unexpected character ~ in "~~~"', template.errors.first.message
end
# Liquid should not catch Exceptions that are not subclasses of StandardError, like Interrupt and NoMemoryError