-
-
Save defunkt/412210 to your computer and use it in GitHub Desktop.
Ruby 1.9 Failing Mustache case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fails on 1.9.1p376 | |
require 'test/unit' | |
require 'mustache' | |
class MTest < Test::Unit::TestCase | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment