Altered property keyword parser tests to be more easily recognizable
parent
afc5d4668d
commit
1f661bebcd
|
@ -26,12 +26,16 @@ var common = require( './common' ),
|
|||
assert = require( 'assert' ),
|
||||
util = common.require( 'util' );
|
||||
|
||||
|
||||
( function testAbstractKeywordDesignatesMethodAsAbstract()
|
||||
{
|
||||
var data = {
|
||||
'abstract foo': [],
|
||||
}
|
||||
},
|
||||
|
||||
var abstract_methods = [],
|
||||
parse_data = {};
|
||||
abstract_methods = [],
|
||||
parse_data = {}
|
||||
;
|
||||
|
||||
|
||||
util.propParse( data, {
|
||||
|
@ -51,20 +55,23 @@ assert.ok(
|
|||
),
|
||||
"Methods with 'abstract' keyword recognized as abstract"
|
||||
);
|
||||
} )();
|
||||
|
||||
|
||||
//
|
||||
// custom parser
|
||||
( function testCustomPropertyKeywordParsersAreSupported()
|
||||
{
|
||||
var data2 = {
|
||||
foo: [],
|
||||
},
|
||||
|
||||
map = {
|
||||
foo: { 'abstract': true },
|
||||
},
|
||||
|
||||
suffix = 'poo',
|
||||
|
||||
abstract_methods_2 = [];
|
||||
abstract_methods_2 = []
|
||||
;
|
||||
|
||||
util.propParse( data2, {
|
||||
keywordParser: function ( prop )
|
||||
|
@ -89,10 +96,11 @@ assert.ok(
|
|||
( abstract_methods_2[ 0 ] === ( 'foo' + suffix ) ),
|
||||
"Can provide custom property keyword parser"
|
||||
);
|
||||
} )();
|
||||
|
||||
|
||||
//
|
||||
// integrity test
|
||||
( function testKeywordParserToleratesBogusResponses()
|
||||
{
|
||||
assert.doesNotThrow( function()
|
||||
{
|
||||
var junk = { foo: 'bar' };
|
||||
|
@ -112,4 +120,5 @@ assert.doesNotThrow( function()
|
|||
}
|
||||
} );
|
||||
}, Error, "Custom keyword parser tolerates bogus response" );
|
||||
} )();
|
||||
|
||||
|
|
Loading…
Reference in New Issue