From 5159d79590799b376df83f41527d1331c9514e9b Mon Sep 17 00:00:00 2001 From: rwldrn Date: Thu, 9 Dec 2010 11:22:06 -0500 Subject: [PATCH] [#211] Update assertions in: Popcorn Plugin: Plugin Factory --- test/popcorn.unit.js | 47 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/test/popcorn.unit.js b/test/popcorn.unit.js index f6b757f..6e5020e 100644 --- a/test/popcorn.unit.js +++ b/test/popcorn.unit.js @@ -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(); -- 2.43.0