@author tests - test that you can have multiple authors

This commit is contained in:
mathematicalcoffee 2013-02-15 12:52:06 +10:00
parent 2ca61c1beb
commit cd1fb6c96a
2 changed files with 18 additions and 4 deletions

View File

@ -2,5 +2,9 @@
@author Michael Mathews <micmath@gmail.com> @author Michael Mathews <micmath@gmail.com>
*/ */
function Thingy() { function Thingy() {
}
}
/** @author John Doe <john.doe@gmail.com>
* @author Jane Doe <jane.doe@gmail.com> */
function Thingy2() {
}

View File

@ -1,8 +1,18 @@
describe("@author tag", function() { describe("@author tag", function() {
var docSet = jasmine.getDocSetFromFile('test/fixtures/authortag.js'), var docSet = jasmine.getDocSetFromFile('test/fixtures/authortag.js'),
Thingy = docSet.getByLongname('Thingy')[0]; Thingy = docSet.getByLongname('Thingy')[0],
Thingy2 = docSet.getByLongname('Thingy2')[0];
it('When a symbol has a @author tag, the doclet has a author property with that value.', function() { it('When a symbol has a @author tag, the doclet has a author property with that value.', function() {
expect(Thingy.author).toBeDefined();
expect(Array.isArray(Thingy.author)).toBe(true);
expect(Thingy.author[0]).toBe('Michael Mathews <micmath@gmail.com>'); expect(Thingy.author[0]).toBe('Michael Mathews <micmath@gmail.com>');
}); });
});
it('When a symbol has multiple @author tags, the doclet has a author property, an array with those values.', function() {
expect(Thingy2.author).toBeDefined();
expect(Array.isArray(Thingy2.author)).toBe(true);
expect(Thingy2.author).toContain('Jane Doe <jane.doe@gmail.com>');
expect(Thingy2.author).toContain('John Doe <john.doe@gmail.com>');
});
});