Skip to content

Commit

Permalink
Add failing 1.9 test
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed May 24, 2010
1 parent 38fbfa7 commit a47d9eb
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/mustache_test.rb
Expand Up @@ -473,4 +473,41 @@ def test_inherited_attributes
assert_equal value, tmpl.send(attr)
end
end
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
end

0 comments on commit a47d9eb

Please sign in to comment.