1
0
Fork 0

Removed visibility dependency from test-class-abstract

closure/master
Mike Gerwitz 2011-03-02 07:53:58 -05:00
parent 40228361a1
commit d74c01b562
1 changed files with 15 additions and 12 deletions

View File

@ -30,20 +30,21 @@ var common = require( './common' ),
// not abstract
var Foo = Class.extend( {} );
// abstract
var AbstractFoo = Class.extend(
// abstract (ctor_called is not a class member to ensure that visibility bugs do
// not impact our test)
var ctor_called = false,
AbstractFoo = Class.extend(
{
ctorCalled: false,
__construct: function()
{
this.ctorCalled = true;
ctor_called = true;
},
'abstract method': [ 'one', 'two', 'three' ],
'abstract second': [],
});
})
;
// still abstract (didn't provide a concrete implementation of both abstract
// methods)
@ -109,8 +110,10 @@ assert.ok(
"Concrete subclasses can be instantiated"
);
ctor_called = false;
new ConcreteFoo();
assert.equal(
( new ConcreteFoo() ).ctorCalled,
ctor_called,
true,
"Can call constructors of abstract supertypes"
);