Changed implementation of For in such a way that it only depends on the existence of a each method. This allows drops to simply implement each for enumeration

This commit is contained in:
Tobias Lütke
2008-05-08 12:30:48 -04:00
parent 7f58cbf82d
commit 4c0cfae0b7
9 changed files with 94 additions and 47 deletions
+15
View File
@@ -57,8 +57,23 @@ class ErrorHandlingTest < Test::Unit::TestCase
end
end
def test_missing_endtag
assert_nothing_raised do
template = Liquid::Template.parse(' {% for a in b %} ... ')
assert_equal ' Liquid error: Unknown operator =! ', template.render
assert_equal 1, template.errors.size
assert_equal Liquid::SyntaxError, template.errors.first.class
end
end
def test_unrecognized_operator
assert_nothing_raised do