From d74c01b5622d284edc73c95cc9288d06d20f93da Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Wed, 2 Mar 2011 07:53:58 -0500 Subject: [PATCH] Removed visibility dependency from test-class-abstract --- test/test-class-abstract.js | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/test/test-class-abstract.js b/test/test-class-abstract.js index ab5883e..91705ff 100644 --- a/test/test-class-abstract.js +++ b/test/test-class-abstract.js @@ -30,20 +30,21 @@ var common = require( './common' ), // not abstract var Foo = Class.extend( {} ); -// abstract -var AbstractFoo = Class.extend( -{ - ctorCalled: false, - - __construct: function() +// 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( { - this.ctorCalled = true; - }, + __construct: function() + { + ctor_called = true; + }, - 'abstract method': [ 'one', 'two', 'three' ], + 'abstract method': [ 'one', 'two', 'three' ], - 'abstract second': [], -}); + '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" );