From 611ee9ab35046c93158ad9a64459d038279ab895 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Wed, 1 Dec 2010 23:13:21 -0500 Subject: [PATCH] Added tests to assure that intefaces can be extended from other interfaces --- test/test-interface-extend.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/test/test-interface-extend.js b/test/test-interface-extend.js index ec9ae51..023d465 100644 --- a/test/test-interface-extend.js +++ b/test/test-interface-extend.js @@ -71,10 +71,23 @@ assert.ok( ); -var SubType = Interface.extend( BaseType, {} ); +var SubType = Interface.extend( BaseType, +{ + second: abstractMethod(), +}); assert.ok( - ( SubType instanceof BaseType ), + ( new SubType() instanceof BaseType ), "Generic interface extend method can extend from other interfaces" ); +assert.ok( + ( SubType.prototype.method === BaseType.prototype.method ), + "Interface subtypes inherit abstract methods" +); + +assert.ok( + ( SubType.prototype.second instanceof Function ), + "Interfaces can be extended with additional abstract methods" +); +