From: rwldrn Date: Sun, 5 Dec 2010 17:58:52 +0000 (-0500) Subject: [#187] Added unit tests for start/end firing controls X-Git-Tag: v0.2~66^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=ab82d12bcbac9a5105556169dccbf5804ba25de1;p=popcorn-js.git [#187] Added unit tests for start/end firing controls --- diff --git a/test/popcorn.unit.js b/test/popcorn.unit.js index 6da4877..a81665b 100644 --- a/test/popcorn.unit.js +++ b/test/popcorn.unit.js @@ -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"); } });