diff options
Diffstat (limited to 'spec/visitor.js')
-rw-r--r-- | spec/visitor.js | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/spec/visitor.js b/spec/visitor.js index b64dc56..66c3b68 100644 --- a/spec/visitor.js +++ b/spec/visitor.js @@ -14,33 +14,29 @@ describe('Visitor', function() { // Simply run the thing and make sure it does not fail and that all of the // stub methods are executed var visitor = new Handlebars.Visitor(); - visitor.accept(Handlebars.parse('{{#foo (bar 1 "1" true) foo=@data}}{{!comment}}{{> bar }} {{/foo}}')); + visitor.accept(Handlebars.parse('{{foo}}{{#foo (bar 1 "1" true) foo=@data}}{{!comment}}{{> bar }} {{/foo}}')); }); it('should traverse to stubs', function() { var visitor = new Handlebars.Visitor(); - visitor.PARTIAL_NAME = function(partialName) { - equal(partialName.name, 'bar'); + visitor.StringLiteral = function(string) { + equal(string.value, '2'); }; - - visitor.STRING = function(string) { - equal(string.string, '2'); - }; - visitor.NUMBER = function(number) { - equal(number.stringModeValue, 1); + visitor.NumberLiteral = function(number) { + equal(number.value, 1); }; - visitor.BOOLEAN = function(bool) { - equal(bool.stringModeValue, true); + visitor.BooleanLiteral = function(bool) { + equal(bool.value, true); }; - visitor.ID = function(id) { - equal(id.original, 'foo.bar'); + visitor.PathExpression = function(id) { + equal(/foo\.bar$/.test(id.original), true); }; - visitor.content = function(content) { - equal(content.string, ' '); + visitor.ContentStatement = function(content) { + equal(content.value, ' '); }; - visitor.comment = function(comment) { - equal(comment.comment, 'comment'); + visitor.CommentStatement = function(comment) { + equal(comment.value, 'comment'); }; visitor.accept(Handlebars.parse('{{#foo.bar (foo.bar 1 "2" true) foo=@foo.bar}}{{!comment}}{{> bar }} {{/foo.bar}}')); |