Merge pull request #98 from jannon/IgnoreValueFix

Test and fix for #84
This commit is contained in:
Jannon Frank 2012-03-21 02:03:34 -07:00
commit d2529644b6
3 changed files with 16 additions and 2 deletions

View File

@ -43,9 +43,9 @@ function TagValueRequiredError(tagName, meta) {
}
TagValueRequiredError.prototype = Error.prototype;
function TagValueNotPermittedError(tagName, message, meta) {
function TagValueNotPermittedError(tagName, meta) {
this.name = 'TagValueNotPermittedError';
this.message = 'The @' + tagName + ' tag does not permit a value: "' + message + '". File: ' + meta.filename + ', Line: ' + meta.lineno + '\n' + meta.comment;
this.message = 'The @' + tagName + ' tag does not permit a value. File: ' + meta.filename + ', Line: ' + meta.lineno + '\n' + meta.comment;
}
TagValueNotPermittedError.prototype = Error.prototype;

6
test/cases/ignoretag2.js Normal file
View File

@ -0,0 +1,6 @@
/**
@ignore value that shouldn't be here
*/
function foo(x) {
}

View File

@ -6,4 +6,12 @@
assert.equal(foo.ignore, true);
});
try {
docSet = testhelpers.getDocSetFromFile('test/cases/ignoretag2.js');
foo = docSet.getByLongname('foo')[0];
} catch (e) {
test('When a symbol has an @ignore tag with a value an error is thrown', function() {
assert.equal(e.name, 'TagValueNotPermittedError');
});
}
})();