Merged last set of changes from original SVN location

This commit is contained in:
Tobias Lütke
2008-05-08 11:34:43 -04:00
parent 1d647361e1
commit 7f58cbf82d
10 changed files with 95 additions and 33 deletions
+16 -3
View File
@@ -4,15 +4,15 @@ require File.dirname(__FILE__) + '/helper'
class ErrorDrop < Liquid::Drop
def standard_error
raise StandardError, 'standard error'
raise Liquid::StandardError, 'standard error'
end
def argument_error
raise ArgumentError, 'argument error'
raise Liquid::ArgumentError, 'argument error'
end
def syntax_error
raise SyntaxError, 'syntax error'
raise Liquid::SyntaxError, 'syntax error'
end
end
@@ -59,6 +59,19 @@ class ErrorHandlingTest < Test::Unit::TestCase
end
def test_unrecognized_operator
assert_nothing_raised do
template = Liquid::Template.parse(' {% if 1 =! 2 %}ok{% endif %} ')
assert_equal ' Liquid error: Unknown operator =! ', template.render
assert_equal 1, template.errors.size
assert_equal Liquid::ArgumentError, template.errors.first.class
end
end
end