1
0
Fork 0

Corrected member_builder-prop tests

- Doesn't properly add method; added as property
closure/master
Mike Gerwitz 2011-05-16 21:21:54 -04:00
parent f47fcf4f46
commit f4b31f2639
1 changed files with 11 additions and 5 deletions

View File

@ -24,11 +24,13 @@
var common = require( './common' ),
assert = require( 'assert' ),
mb_common = require( __dirname + '/inc-member_builder-common' )
mb_common = require( __dirname + '/inc-member_builder-common' ),
builder = common.require( 'member_builder' )
;
mb_common.value = { bar: 'baz' };
mb_common.buildMember = common.require( 'member_builder' ).buildProp;
mb_common.value = { baj: 'baz' };
mb_common.buildMember = builder.buildProp
// do assertions common to all member builders
mb_common.assertCommon();
@ -36,12 +38,16 @@ mb_common.assertCommon();
( function testCannotOverrideMethodWithProperty()
{
// this will be considered a method, as it is a function
// add a method
mb_common.buildMember = builder.buildMethod;
mb_common.value = function() {};
mb_common.buildMemberQuick();
assert.throws( function()
{
// reset
mb_common.buildMember = builder.buildProp;
// attempt to override with property
mb_common.value = 'foo';
mb_common.buildMemberQuick( {}, true );