Localize errors in Liquid

This commit is contained in:
Simon Eskildsen
2013-08-30 12:31:57 -04:00
parent 29cdabc30e
commit 072c12dc47
13 changed files with 55 additions and 22 deletions
+7
View File
@@ -40,6 +40,13 @@ module Test
assert_match expected, Template.parse(template).render(assigns)
end
def assert_match_syntax_error(match, template, registers = {})
exception = assert_raise(Liquid::SyntaxError) {
Template.parse(template).render(assigns)
}
assert_match match, exception.message
end
def with_error_mode(mode)
old_mode = Liquid::Template.error_mode
Liquid::Template.error_mode = mode