From 662b2983fefb07012d51632a64243433ce81b3e9 Mon Sep 17 00:00:00 2001 From: "Mark H. Wilkinson" Date: Tue, 12 Apr 2011 13:50:50 +0100 Subject: [PATCH] Failing test for integer drop lookup. --- test/lib/liquid/drop_test.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/lib/liquid/drop_test.rb b/test/lib/liquid/drop_test.rb index 9755280a..4d74a1d9 100644 --- a/test/lib/liquid/drop_test.rb +++ b/test/lib/liquid/drop_test.rb @@ -36,7 +36,7 @@ class ProductDrop < Liquid::Drop class CatchallDrop < Liquid::Drop def before_method(method) - return 'method: ' << method + return 'method: ' << method.to_s end end @@ -94,6 +94,11 @@ class DropsTest < Test::Unit::TestCase end + def test_integer_argument_drop + output = Liquid::Template.parse( ' {{ product.catchall[8] }} ' ).render('product' => ProductDrop.new) + assert_equal ' method: 8 ', output + end + def test_text_array_drop output = Liquid::Template.parse( '{% for text in product.texts.array %} {{text}} {% endfor %}' ).render('product' => ProductDrop.new) assert_equal ' text1 text2 ', output