Resolve InputIterator dropping context (#1184)

* Resolve InputIterator dropping context

* Prefer attr_reader
This commit is contained in:
Mike Angell
2019-10-09 08:00:16 +11:00
committed by GitHub
parent 04b800d768
commit 2bfeed2b00
2 changed files with 19 additions and 10 deletions
+5
View File
@@ -179,6 +179,11 @@ class DropsTest < Minitest::Test
assert_equal(' carrot ', output)
end
def test_context_drop_array_with_map
output = Liquid::Template.parse(' {{ contexts | map: "bar" }} ').render!('contexts' => [ContextDrop.new, ContextDrop.new], 'bar' => "carrot")
assert_equal(' carrotcarrot ', output)
end
def test_nested_context_drop
output = Liquid::Template.parse(' {{ product.context.foo }} ').render!('product' => ProductDrop.new, 'foo' => "monkey")
assert_equal(' monkey ', output)