Skip to content

Instantly share code, notes, and snippets.

@defunkt
Forked from rafaelss/mustache_test.rb
Created May 24, 2010 18:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save defunkt/412210 to your computer and use it in GitHub Desktop.
Save defunkt/412210 to your computer and use it in GitHub Desktop.
Ruby 1.9 Failing Mustache case
# 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