From 66d4b0623a5e49fccdfae25e1423a6df51be78cf Mon Sep 17 00:00:00 2001 From: mathematicalcoffee Date: Tue, 26 Feb 2013 14:59:52 +1000 Subject: [PATCH] updated @listens test to use a fixture --- test/fixtures/listenstag.js | 7 +++++++ test/specs/tags/listenstag.js | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 test/fixtures/listenstag.js diff --git a/test/fixtures/listenstag.js b/test/fixtures/listenstag.js new file mode 100644 index 00000000..d72f1865 --- /dev/null +++ b/test/fixtures/listenstag.js @@ -0,0 +1,7 @@ +/** An event handler. + * @function + * @listens Foo + * @listens Bar + */ +function handler () { +} diff --git a/test/specs/tags/listenstag.js b/test/specs/tags/listenstag.js index 59cec9c1..51d90d01 100644 --- a/test/specs/tags/listenstag.js +++ b/test/specs/tags/listenstag.js @@ -1,6 +1,6 @@ describe("@listens tag", function() { - var doclet = require('jsdoc/doclet'), - doc = new doclet.Doclet('/** An event handler\n@function handler\n@listens Foo\n@listens Bar */', {}); + var docSet = jasmine.getDocSetFromFile('test/fixtures/listenstag.js'), + doc = docSet.getByLongname('handler')[0]; 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();