Proper warning support

This commit is contained in:
Tristan Hume
2013-08-19 15:14:26 -04:00
parent eb68a751ac
commit 047900d0dd
4 changed files with 15 additions and 1 deletions

View File

@@ -79,6 +79,13 @@ class ErrorHandlingTest < Test::Unit::TestCase
end
end
def test_warnings
template = Liquid::Template.parse('{% if ~~~ %}derp{% else %}wat{% endif %}', :error_mode => :warn)
assert_equal 'wat', template.render
assert_equal 1, template.errors.size
assert_equal 'Unexpected character ~.', template.errors.first.message
end
# Liquid should not catch Exceptions that are not subclasses of StandardError, like Interrupt and NoMemoryError
def test_exceptions_propagate
assert_raise Exception do