tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject [2/5] git commit: Add test for respondFirst
Date Sat, 14 Jul 2012 00:49:39 GMT
Add test for respondFirst


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/6dfb831c
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/6dfb831c
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/6dfb831c

Branch: refs/heads/5.4-js-rewrite
Commit: 6dfb831c4753df5dad1600dc35c7e6b939de2113
Parents: 18be367
Author: Howard M. Lewis Ship <hlship@apache.org>
Authored: Fri Jul 13 17:32:42 2012 -0700
Committer: Howard M. Lewis Ship <hlship@apache.org>
Committed: Fri Jul 13 17:32:42 2012 -0700

----------------------------------------------------------------------
 .../integration/app1/pages/test-pubsub.coffee      |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6dfb831c/tapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-pubsub.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-pubsub.coffee
b/tapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-pubsub.coffee
index f1eff43..b7b6e62 100644
--- a/tapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-pubsub.coffee
+++ b/tapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-pubsub.coffee
@@ -4,6 +4,7 @@ require ["core/pubsub"], (pubsub) ->
   test "export aliases", ->
     ok pubsub.on is pubsub.respondTo, "on and respondTo"
     ok pubsub.off is pubsub.stopResponding, "off and stopResponding"
+    ok pubsub.first is pubsub.respondFirst, "first and respondFirst"
 
   test "simple on/fire", ->
     memoValue = null
@@ -72,6 +73,16 @@ require ["core/pubsub"], (pubsub) ->
 
     deepEqual log, ["b:beta-second"], "only 'beta' responder invoked after removal"
 
+  test "respondFirst is invoked first", ->
+
+    log = []
+
+    pubsub.on "stim", -> log.push "alpha"
+    pubsub.first "stim", -> log.push "bravo"
+
+    pubsub.fire "stim"
+
+    deepEqual log, ["bravo", "alpha"], "first responder invoked first"
 
 
 


Mime
View raw message