Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def test_array_of_arrays
template = <<template
{{#items}}
start
{{#map}}
{{a}}
{{/map}}
end
{{/items}}
template
data = {
"items" => [
[ {"a" => 1}, {"a" => 2}, {"a" => 3} ],
[ {"a" => 4}, {"a" => 5}, {"a" => 6} ],
[ {"a" => 7}, {"a" => 8}, {"a" => 9} ]
]
}
assert_equal <<expected, Mustache.render(template, data)
start
1
2
3
end
start
4
5
6
end
start
7
8
9
end
expected
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment