Created
August 20, 2013 17:12
-
-
Save paularmstrong/6284333 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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