From: rwldrn Date: Sat, 4 Dec 2010 21:23:00 +0000 (-0500) Subject: Applies to #157 X-Git-Tag: v0.2~68^2~10 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=92421758fd04806a6f4e75d248a2a373ad16abf8;p=popcorn-js.git Applies to #157 --- diff --git a/popcorn.js b/popcorn.js index ae5f43f..095a903 100644 --- a/popcorn.js +++ b/popcorn.js @@ -246,7 +246,7 @@ // Provides some sugar, but ultimately extends // the definition into Popcorn.p - var plugin = {}; + var plugin = {}; plugin[ name ] = definition; diff --git a/test/popcorn-api-draft-unit.js b/test/popcorn-api-draft-unit.js index 87e857c..98d67fb 100644 --- a/test/popcorn-api-draft-unit.js +++ b/test/popcorn-api-draft-unit.js @@ -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"); - - });