Permalink
Browse files

Merge branch 'master' of github.com:hakanson/tccc11

  • Loading branch information...
2 parents c46124e + 6ca5dc7 commit 7417aee2b8d332c005c48a4cb66a247e5e700f5c @hakanson committed Oct 6, 2011
Showing with 14 additions and 2 deletions.
  1. +1 −0 tests/TestRunner.html
  2. +13 −2 tests/jquery-hub.tests.js
View
1 tests/TestRunner.html
@@ -2,6 +2,7 @@
<html>
<head>
<title>$.hub Test Runner</title>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script type="text/javascript">window.JSON || document.write('<script src="../JSON/json2.js"><\/script>')</script>
<script type="text/javascript" src="../jquery-1.6.3.js"></script>
<link rel="stylesheet" href="qunit.css" type="text/css" media="screen"/>
View
15 tests/jquery-hub.tests.js
@@ -455,14 +455,25 @@ test( "only receive same message once", function() {
subscriber1 = $.hub.subscribe( channel, callback1, null, null, createIdempotentFilter() );
subscriber2 = $.hub.subscribe( channel, callback2, null, null, createIdempotentFilter() );
+ // should only get one of these
$.hub.publish( channel, m1 );
$.hub.publish( channel, m1 );
+
+ // should only get one of these
$.hub.publish( channel, m2 );
$.hub.publish( channel, m2 );
$.hub.publish( channel, m2 );
- equal( count1, 2 );
- equal( count2, 2 );
+ // should get both of these (no message id)
+ $.hub.publish( channel, null );
+ $.hub.publish( channel, null );
+
+ // should get both of these (no message id)
+ $.hub.publish( channel, {} );
+ $.hub.publish( channel, {} );
+
+ equal( count1, 6 );
+ equal( count2, 6 );
$.hub.unsubscribe( subscriber1 );
$.hub.unsubscribe( subscriber2 );

0 comments on commit 7417aee

Please sign in to comment.