updated @listens test to use a fixture

This commit is contained in:
mathematicalcoffee 2013-02-26 14:59:52 +10:00
parent db3451be72
commit 66d4b0623a
2 changed files with 9 additions and 2 deletions

7
test/fixtures/listenstag.js vendored Normal file
View File

@ -0,0 +1,7 @@
/** An event handler.
* @function
* @listens Foo
* @listens Bar
*/
function handler () {
}

View File

@ -1,6 +1,6 @@
describe("@listens tag", function() { describe("@listens tag", function() {
var doclet = require('jsdoc/doclet'), var docSet = jasmine.getDocSetFromFile('test/fixtures/listenstag.js'),
doc = new doclet.Doclet('/** An event handler\n@function handler\n@listens Foo\n@listens Bar */', {}); doc = docSet.getByLongname('handler')[0];
it("should create a 'listens' property on the doclet, an array, with the events that are listened to", function() { it("should create a 'listens' property on the doclet, an array, with the events that are listened to", function() {
expect(Array.isArray(doc.listens)).toBeTruthy(); expect(Array.isArray(doc.listens)).toBeTruthy();