From bdfac98755d84708ebfd8dc40d12e4b6cc1a2c5d Mon Sep 17 00:00:00 2001 From: mathematicalcoffee Date: Fri, 15 Feb 2013 14:20:23 +1000 Subject: [PATCH] @function: added tests --- test/specs/tags/functiontag.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/specs/tags/functiontag.js diff --git a/test/specs/tags/functiontag.js b/test/specs/tags/functiontag.js new file mode 100644 index 00000000..ecd8e202 --- /dev/null +++ b/test/specs/tags/functiontag.js @@ -0,0 +1,18 @@ +describe("@function tag", function() { + var doclet = require('jsdoc/doclet'), + doc = new doclet.Doclet('/** @func Foo */', {}), + doc2 = new doclet.Doclet('/** @method */', {}); + + it("sets the doclet's kind to 'function'", function() { + expect(doc.kind).toBe('function'); + expect(doc2.kind).toBe('function'); + }); + + it("sets the doclet's name to the tag value, if provided", function() { + expect(doc.name).toBe('Foo'); + expect(doc2.name).toBeFalsy(); + }); + + // parameter etc tests take place elsewhere: on its own, all @func does is + // set doclet.kind to function and sets the doclet's name. +});