test/liquid/drop_test.rb in liquid-2.4.1 vs test/liquid/drop_test.rb in liquid-2.5.0
- old
+ new
@@ -113,9 +113,16 @@
def test_protected
output = Liquid::Template.parse( ' {{ product.callmenot }} ' ).render('product' => ProductDrop.new)
assert_equal ' ', output
end
+ def test_object_methods_not_allowed
+ [:dup, :clone, :singleton_class, :eval, :class_eval, :inspect].each do |method|
+ output = Liquid::Template.parse(" {{ product.#{method} }} ").render('product' => ProductDrop.new)
+ assert_equal ' ', output
+ end
+ end
+
def test_scope
assert_equal '1', Liquid::Template.parse( '{{ context.scopes }}' ).render('context' => ContextDrop.new)
assert_equal '2', Liquid::Template.parse( '{%for i in dummy%}{{ context.scopes }}{%endfor%}' ).render('context' => ContextDrop.new, 'dummy' => [1])
assert_equal '3', Liquid::Template.parse( '{%for i in dummy%}{%for i in dummy%}{{ context.scopes }}{%endfor%}{%endfor%}' ).render('context' => ContextDrop.new, 'dummy' => [1])
end