incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [3/4] js commit: add a test when channel has same handlers subscribed many times
Date Thu, 31 May 2012 18:07:51 GMT
add a test when channel has same handlers subscribed many times


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/16091ff8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/16091ff8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/16091ff8

Branch: refs/heads/master
Commit: 16091ff806883b8b638cb9d8486128a3d4582504
Parents: 8d72642
Author: Julien Bouquillon <julien@bouquillon.com>
Authored: Thu May 24 09:15:43 2012 +0200
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Thu May 31 10:27:01 2012 -0700

----------------------------------------------------------------------
 test/test.channel.js |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/16091ff8/test/test.channel.js
----------------------------------------------------------------------
diff --git a/test/test.channel.js b/test/test.channel.js
index d998da9..cd86cec 100644
--- a/test/test.channel.js
+++ b/test/test.channel.js
@@ -74,6 +74,20 @@ describe("channel", function () {
             c.unsubscribe(thirdHandler);
 
             expect(c.numHandlers).toEqual(initialLength - 1);
+
+            c.unsubscribe(firstHandler);
+            c.unsubscribe(secondHandler);
+
+            expect(c.numHandlers).toEqual(0);
+
+            c.subscribe(firstHandler);
+            c.subscribe(firstHandler);
+
+            c.unsubscribe(firstHandler);
+            c.unsubscribe(firstHandler);
+
+            expect(c.numHandlers).toEqual(0);
+
         });
     });
 });


Mime
View raw message