summaryrefslogtreecommitdiffstats
path: root/spec/qunit_spec.js
diff options
context:
space:
mode:
authorRyan Grove <ryan@wonko.com>2011-04-28 22:30:21 -0700
committerRyan Grove <ryan@wonko.com>2011-04-28 22:30:21 -0700
commitb324d002ca42a7a148b6b7d756319c8becc328fb (patch)
tree23a6e1a47d42c37c6a97890d4dca7790bdb18493 /spec/qunit_spec.js
parent038d9b3feed51bc12db95af0e0ef8b69776b42c9 (diff)
downloadhandlebars.js-b324d002ca42a7a148b6b7d756319c8becc328fb.zip
handlebars.js-b324d002ca42a7a148b6b7d756319c8becc328fb.tar.gz
handlebars.js-b324d002ca42a7a148b6b7d756319c8becc328fb.tar.bz2
Allow ids to contain hyphens. Fixes #36.
Previously, a mustache like {{foo-bar}} would generate a parse error, which was a departure from the behavior of other Mustache implementations.
Diffstat (limited to 'spec/qunit_spec.js')
-rw-r--r--spec/qunit_spec.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/qunit_spec.js b/spec/qunit_spec.js
index b8191ff..0dabd0f 100644
--- a/spec/qunit_spec.js
+++ b/spec/qunit_spec.js
@@ -106,6 +106,10 @@ test("functions with context argument", function() {
"Frank", "functions are called with context arguments");
});
+test("paths with hyphens", function() {
+ shouldCompileTo("{{foo-bar}}", {"foo-bar": "baz"}, "baz", "Paths can contain hyphens (-)");
+});
+
test("nested paths", function() {
shouldCompileTo("Goodbye {{alan/expression}} world!", {alan: {expression: "beautiful"}},
"Goodbye beautiful world!", "Nested paths access nested objects");