Fix mapping over proc attributes

This commit is contained in:
Guillaume Malette
2015-11-20 13:04:42 -05:00
parent 5f8086572b
commit 0b55d09cea
2 changed files with 15 additions and 1 deletions
+13
View File
@@ -249,6 +249,19 @@ class StandardFiltersTest < Minitest::Test
assert_template_result "testfoo", templ, "procs" => [p]
end
def test_map_over_drops_returning_procs
drops = [
{
"proc" => ->{ "foo" },
},
{
"proc" => ->{ "bar" },
},
]
templ = '{{ drops | map: "proc" }}'
assert_template_result "foobar", templ, "drops" => drops
end
def test_map_works_on_enumerables
assert_template_result "123", '{{ foo | map: "foo" }}', "foo" => TestEnumerable.new
end