Guest User

Untitled

a guest
May 26th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. def test_array_of_arrays
  2. template = <<template
  3. {{#items}}
  4. start
  5. {{#map}}
  6. {{a}}
  7. {{/map}}
  8. end
  9. {{/items}}
  10. template
  11.  
  12. data = {
  13. "items" => [
  14. [ {"a" => 1}, {"a" => 2}, {"a" => 3} ],
  15. [ {"a" => 4}, {"a" => 5}, {"a" => 6} ],
  16. [ {"a" => 7}, {"a" => 8}, {"a" => 9} ]
  17. ]
  18. }
  19.  
  20. assert_equal <<expected, Mustache.render(template, data)
  21. start
  22. 1
  23. 2
  24. 3
  25. end
  26. start
  27. 4
  28. 5
  29. 6
  30. end
  31. start
  32. 7
  33. 8
  34. 9
  35. end
  36. expected
  37. end
Add Comment
Please, Sign In to add comment