Skip to content

Instantly share code, notes, and snippets.

@paularmstrong
Created August 20, 2013 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paularmstrong/6284333 to your computer and use it in GitHub Desktop.
Save paularmstrong/6284333 to your computer and use it in GitHub Desktop.
diff --git a/tests/variables.test.js b/tests/variables.test.js
index fc7cc70..162dc11 100644
--- a/tests/variables.test.js
+++ b/tests/variables.test.js
@@ -61,6 +61,9 @@ var cases = {
{ c: '{{ food.a }}', e: 'tacos' },
{ c: '{{ food["a"] }}', e: 'tacos' },
{ c: '{{ g[0][h.g.i]["c"].b[i] }}', e: 'hi!' },
+ ],
+ 'getters work just fine': [
+ { c: '{{ p.b }}', e: 'blarg' }
]
};
@@ -78,8 +81,12 @@ describe('Variables', function () {
h: { g: { i: 'q' } },
i: 'foo',
o: Object.create({ foo: function () { return 'bar'; } }),
- o2: { a: 'bar', foo: function (b) { return b || this.a; } }
+ o2: { a: 'bar', foo: function (b) { return b || this.a; } },
+ p: {}
}};
+ Object.defineProperty(opts.locals.p, 'b', {
+ get: function () { return 'blarg' }
+ });
_.each(cases, function (cases, description) {
describe(description, function () {
_.each(cases, function (c) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment