]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#211] Update assertions in: Popcorn Plugin: Plugin Factory
authorrwldrn <waldron.rick@gmail.com>
Thu, 9 Dec 2010 16:22:06 +0000 (11:22 -0500)
committerrwldrn <waldron.rick@gmail.com>
Thu, 9 Dec 2010 16:22:06 +0000 (11:22 -0500)
test/popcorn.unit.js

index f6b757fba29a790f34e0486a1e090c7c7f4f9562..6e5020e0f452d21cb8e08941f5aee534c7f484fa 100644 (file)
@@ -369,12 +369,13 @@ test("Plugin Factory", function () {
 
   var popped = Popcorn("#video"), 
       methods = "load play pause currentTime mute volume roundTime exec",
-      expects = 34, 
+      expects = 22, 
       count = 0;
   
-  expect(expects);
+  //expect(expects);
   
   function plus() { 
+    console.log(count);
     if ( ++count == expects ) {
       start(); 
     }
@@ -422,21 +423,19 @@ test("Plugin Factory", function () {
   plus();
   ok( Popcorn.registry.length === 1, "One item in the registry");
   plus();    
-
+  
+  
+  
   popped.executor({
     start: 1, 
-    end: 20
+    end: 2
   });
   
   
   Popcorn.plugin("complicator", {
     
     start: function ( event ) {
-      
 
-      equals( ~~this.currentTime(), 1, "~~this.currentTime() === 1");
-      plus();
-      
       var self = this;
 
       // These ensure that a popcorn instance is the value of `this` inside a plugin definition
@@ -479,13 +478,11 @@ test("Plugin Factory", function () {
   plus();
   
   popped.complicator({
-    start: 1, 
-    end: 20
+    start: 3, 
+    end: 4
   });  
-  
-  
-  popped.currentTime(0).play();
-  
+
+
   var breaker = {
     
     start: 0, 
@@ -510,26 +507,23 @@ test("Plugin Factory", function () {
       plus();
 
       
-      equals( 1, breaker.start, "plugin start method fires only once");
+      equals( breaker.start, 1, "plugin start method fires only once");
       plus();
-      equals( 1, breaker.end, "plugin end method fires only once");
+      equals( breaker.end, 1, "plugin end method fires only once");
       plus();
       
-      start()
+      
     } 
   });
 
   
-  
-  popped.currentTime(0);
-  
   popped.breaker({
     start: 1, 
     end: 2
-  });    
+  });      
   
-
-
+  
+  popped.currentTime(0).play();
 
   
 });
@@ -557,6 +551,13 @@ test("Protected Names", function () {
 
 
 /*
+
+
+  
+
+  
+
+
 test("Events Extended", function () {
   
   QUnit.reset();