Permalink
Browse files

Add tests that fail for namespaced methods and properties, such as Ap…

…p.Database.prototype.save
  • Loading branch information...
adamsanderson committed Jun 4, 2012
1 parent 5a031ec commit c13835e824b842bb7671ab7446070c0f45654cba
Showing with 15 additions and 0 deletions.
  1. +15 −0 test/dox.test.js
View
@@ -176,6 +176,13 @@ module.exports = {
ctx.name.should.equal('save');
},
+ 'test .parseCodeContext() prototype method in a namespace': function(){
+ var ctx = dox.parseCodeContext('App.User.prototype.save = function(){}');
+ ctx.type.should.equal('method');
+ ctx.constructor.should.equal('App.User');
+ ctx.name.should.equal('save');
+ },
+
'test .parseCodeContext() prototype property': function(){
var ctx = dox.parseCodeContext('Database.prototype.enabled = true;\nasdf');
ctx.type.should.equal('property');
@@ -184,6 +191,14 @@ module.exports = {
ctx.value.should.equal('true');
},
+ 'test .parseCodeContext() prototype property in a namespace': function(){
+ var ctx = dox.parseCodeContext('App.Database.prototype.enabled = true;\nasdf');
+ ctx.type.should.equal('property');
+ ctx.constructor.should.equal('App.Database');
+ ctx.name.should.equal('enabled');
+ ctx.value.should.equal('true');
+ },
+
'test .parseCodeContext() method': function(){
var ctx = dox.parseCodeContext('user.save = function(){}');
ctx.type.should.equal('method');

0 comments on commit c13835e

Please sign in to comment.