Skip to content

Commit

Permalink
Added addition tests for the @default tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
micmath committed Apr 10, 2011
1 parent 2b3553d commit 7fc4708
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
17 changes: 16 additions & 1 deletion test/cases/defaulttag.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,22 @@ var response = 'ok';
*/
var rcode = 200;

/**
@default
*/
var rvalid = true;

/**
@default
*/
var rerrored = false;

/**
@default the parent window
*/
var win = getParentWindow();
var win = getParentWindow();

/**
@default
*/
var header = getHeaders(request);
17 changes: 16 additions & 1 deletion test/t/cases/defaulttag.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
request = (docSet.getByLongname('request') || [])[0],
response = (docSet.getByLongname('response') || [])[0],
rcode = (docSet.getByLongname('rcode') || [])[0],
rvalid = (docSet.getByLongname('rvalid') || [])[0],
rerrored = (docSet.getByLongname('rerrored') || [])[0],
win = (docSet.getByLongname('win') || [])[0];
header = (docSet.getByLongname('header') || [])[0];

//dump(docSet);
//dump(response);

test('When symbol set to null has a @default tag with no text.', function() {
assert.equal(request.defaultvalue, 'null', 'The doclet\'s defaultValue property should be: undefined.');
Expand All @@ -23,4 +26,16 @@
assert.equal(win.defaultvalue, 'the parent window', 'The doclet\'s defaultValue property should be that text.');
});

test('When symbol has a @default tag with true.', function() {
assert.equal(rvalid.defaultvalue, 'true');
});

test('When symbol has a @default tag with false.', function() {
assert.equal(rerrored.defaultvalue, 'false');
});

test('When symbol has a @default tag with a function call.', function() {
assert.equal(typeof header.defaultvalue, 'undefined');
});

})();

0 comments on commit 7fc4708

Please sign in to comment.