diff --git a/test/cases/returnstag.js b/test/cases/returnstag.js new file mode 100644 index 00000000..d3cf4de4 --- /dev/null +++ b/test/cases/returnstag.js @@ -0,0 +1,11 @@ +/** +* @returns { String | Array} The names of the found item(s). +*/ +function find(targetName) { +} + +/** +* @return The binding id. +*/ +function bind(callback) { +} diff --git a/test/t/cases/returnstag.js b/test/t/cases/returnstag.js new file mode 100644 index 00000000..a02762c5 --- /dev/null +++ b/test/t/cases/returnstag.js @@ -0,0 +1,20 @@ +(function() { + var docSet = testhelpers.getDocSetFromFile('test/cases/returnstag.js'), + find = docSet.getByLongname('find')[0], + bind = docSet.getByLongname('bind')[0]; + + //dump(docSet.doclets); exit(0); + + test('When a symbol has an @returns tag with a type and description, the doclet has a returns property that includes that return.', function() { + assert.equal(typeof find.returns, 'object'); + assert.equal(find.returns.type.names.join(', '), 'String, Array'); + assert.equal(find.returns.description, 'The names of the found item(s).'); + }); + + test('When a symbol has an @param tag with only a type and name, the doclet has a params property that includes that param.', function() { + assert.equal(typeof bind.returns, 'object'); + assert.equal(bind.returns.description, 'The binding id.'); + }); + + +})(); \ No newline at end of file