Skip to content

Instantly share code, notes, and snippets.

Created September 16, 2010 08:00
Show Gist options
  • Save anonymous/582118 to your computer and use it in GitHub Desktop.
Save anonymous/582118 to your computer and use it in GitHub Desktop.
test("empty block", function() {
// This test currently fails. Issue #7
// the {{#goodbyes}}{{/goodbyes}} should ideally noop
var string = "{{#goodbyes}}{{/goodbyes}}cruel {{world}}!"
var hash = {goodbyes: [{text: "goodbye"}, {text: "Goodbye"}, {text: "GOODBYE"}], world: "world"};
shouldCompileTo(string, hash, "cruel world!",
"Arrays iterate over the contents when not empty");
shouldCompileTo(string, {goodbyes: [], world: "world"}, "cruel world!",
"Arrays ignore the contents when empty");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment