]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#187] Added unit tests for start/end firing controls
authorrwldrn <waldron.rick@gmail.com>
Sun, 5 Dec 2010 17:58:52 +0000 (12:58 -0500)
committerrwldrn <waldron.rick@gmail.com>
Sun, 5 Dec 2010 17:58:52 +0000 (12:58 -0500)
test/popcorn.unit.js

index 6da487709a50fb2160ff520e279b43f008ed88be..a81665b82a54c51b6da328f3b9ce8dce10301bc6 100644 (file)
@@ -331,15 +331,31 @@ test("Plugin API", function () {
     end: 2
   });  
   
+  
+  var breaker = {
+    
+    start: 0, 
+    end: 0
+    
+  };
 
   Popcorn.plugin("breaker", {
     
     start: function () {
+      
+      breaker.start++;
+    
       ok(true, "plugin:breaker started");
     },
     end: function () {
+      
+      breaker.end++;
+    
       ok(true, "plugin:ended started");
       start();
+      
+      equals( 1, breaker.start, "plugin start method fires only once");
+      equals( 1, breaker.end, "plugin end method fires only once");
     } 
   });