Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…p.Database.prototype.save
  • Loading branch information...
commit c13835e824b842bb7671ab7446070c0f45654cba 1 parent 5a031ec
@adamsanderson authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 test/dox.test.js
View
15 test/dox.test.js
@@ -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');
Please sign in to comment.
Something went wrong with that request. Please try again.