]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Applies to #157
authorrwldrn <waldron.rick@gmail.com>
Sat, 4 Dec 2010 21:23:00 +0000 (16:23 -0500)
committerrwldrn <waldron.rick@gmail.com>
Sat, 4 Dec 2010 21:23:00 +0000 (16:23 -0500)
popcorn.js
test/popcorn-api-draft-unit.js

index ae5f43ff72bed6d7c5fe356ab823cfae70e78e77..095a903a8eca661ee0364cff7b4c164204317f6b 100644 (file)
     //  Provides some sugar, but ultimately extends
     //  the definition into Popcorn.p 
     
-    var plugin  = {};
+    var plugin = {};
     
     plugin[ name ] = definition;
     
index 87e857c0cf726f14811cf5e261aa552da6171f78..98d67fb96ab1a4eede45b0516d4e2e606bd922d5 100644 (file)
@@ -118,19 +118,15 @@ test("Popcorn Events Stored By Type", function () {
   
   var p = Popcorn("#video"), 
       count = 0,
-      fired = 0
+      fired = 0, 
+      wants = 4
       ;
 
   function plus(){ 
 
     if ( ++count == 4 ) {
       
-      if ( fired === 4 ) {
-        ok( true, fired + " callbacks fired from 1 handler" );
-      }
-      else {
-        ok( false, fired + " callbacks fired - CHECK HANDLERS" );
-      }
+      equals( fired, wants, "Number of callbacks fired from 1 handler" );
 
       p.unlisten("play");
   
@@ -146,35 +142,33 @@ test("Popcorn Events Stored By Type", function () {
   p.listen("play", function () {
     fired++;
     
-    ok(true, "Play fired");
+    ok(true, "Play fired " + fired);
     plus();
   });
       
   p.listen("play", function () {
     fired++;
 
-    ok(true, "Play fired");    
+    ok(true, "Play fired " + fired);    
     plus();
   });
 
   p.listen("play", function () {
     fired++;
 
-    ok(true, "Play fired");    
+    ok(true, "Play fired " + fired);    
     plus();
   });
 
   p.listen("play", function () {
     fired++;
 
-    ok(true, "Play fired");
+    ok(true, "Play fired " + fired);
     plus();
   });
   
   p.trigger("play");
   
-
-  
 });