From 2c26a880f0cee54bde80db171a8fceecba251c79 Mon Sep 17 00:00:00 2001 From: Tom Burns Date: Sun, 24 Nov 2013 12:32:32 -0500 Subject: [PATCH] add another test showing equivalent functionality --- test/liquid/tags/for_tag_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/liquid/tags/for_tag_test.rb b/test/liquid/tags/for_tag_test.rb index b98f7f0..4dde8a4 100644 --- a/test/liquid/tags/for_tag_test.rb +++ b/test/liquid/tags/for_tag_test.rb @@ -342,4 +342,14 @@ HERE assert !loader.each_called assert loader.load_slice_called end + + def test_iterate_with_load_slice_returns_same_results_as_without + loader = LoaderDrop.new([1,2,3,4,5]) + loader_assigns = {'items' => loader} + array_assigns = {'items' => [1,2,3,4,5]} + expected = '34' + template = '{% for item in items offset:2 limit:2 %}{{item}}{% endfor %}' + assert_template_result(expected, template, loader_assigns) + assert_template_result(expected, template, array_assigns) + end end