diff --git a/templates/default/tmpl/container.tmpl b/templates/default/tmpl/container.tmpl index 862ac71d..0e1bde1c 100644 --- a/templates/default/tmpl/container.tmpl +++ b/templates/default/tmpl/container.tmpl @@ -31,6 +31,10 @@
+ + + + diff --git a/test/fixtures/moduleisconstructor.js b/test/fixtures/moduleisconstructor.js index 1990d7f7..c7a22803 100644 --- a/test/fixtures/moduleisconstructor.js +++ b/test/fixtures/moduleisconstructor.js @@ -4,10 +4,12 @@ */ /** - Create a new configuration - @param {string} id - @constructor + Create a new configuration. + + @classdesc Describe the class here. + @class @alias module:mymodule/config + @param {string} id */ function Config(id) { /** Document me. */ diff --git a/test/specs/documentation/moduleisconstructor.js b/test/specs/documentation/moduleisconstructor.js index 6b0cbe61..16c595f9 100644 --- a/test/specs/documentation/moduleisconstructor.js +++ b/test/specs/documentation/moduleisconstructor.js @@ -1,5 +1,43 @@ /*global describe: true, expect: true, it: true, xdescribe: true */ -xdescribe('module that exports a constructor', function() { - // TODO +describe('module that exports a constructor', function() { + var docSet = jasmine.getDocSetFromFile('test/fixtures/moduleisconstructor.js'); + var modules = docSet.doclets.filter(function(doclet) { + return doclet.kind === 'module'; + }); + var classes = docSet.doclets.filter(function(doclet) { + return doclet.kind === 'class'; + }); + + it('should include one doclet whose kind is "module"', function() { + expect(modules.length).toBe(1); + expect(modules[0].kind).toBe('module'); + }); + + it('should include one doclet whose kind is "class"', function() { + expect(classes.length).toBe(1); + expect(classes[0].kind).toBe('class'); + }); + + describe('class doclet', function() { + it('should include a "description" property that contains the constructor description', function() { + expect(classes[0].description).toEqual('Create a new configuration.'); + }); + + it('should include a "class-description" property', function() { + expect(classes[0].classdesc).toEqual('Describe the class here.'); + }); + }); + + describe('module doclet', function() { + it('should include a "description" property that contains the module description', function() { + expect(modules[0].description).toEqual('Describe the module here.'); + }); + + // TODO: this is the missing piece of information -- the module property is not available when testing, but is available within the template + xit('should be able to access the class information via the module', function() { + expect(modules[0].module.description).toEqual('Create a new configuration.'); + expect(modules[0].module.classdesc).toEqual('Describe the class here.'); + }); + }); }); \ No newline at end of file