};
- //addes a Popcorn instance to the Popcorn instance array
+ // Addes a Popcorn instance to the Popcorn instance array
Popcorn.addInstance = function( popcornInstance ) {
if ( !popcornInstance.video.id ) {
};
- //User passes in the name of the Popcorn instance and receive a popcorn object
+ // User passes in the name of the Popcorn instance and receive a popcorn object
Popcorn.getInstanceById = function( name ) {
return Popcorn.instances[ Popcorn.instanceIds[ name ] ];
});
test("Instances", function() {
- var popped = Popcorn("#video");
- var popped2 = Popcorn("#video");
- var popped3 = Popcorn("#video");
- var expects = 9,
- count = 0;
+ var popped = Popcorn("#video"),
+ expects = 9,
+ count = 0,
+ instance;
expect(expects);
ok( "length" in Popcorn.instances && "join" in Popcorn.instances, "Popcorn.instances is a provided cache array");
plus();
- var instance;
instance = Popcorn.getInstanceById("video");
ok( instance.video, "Stored instance as a `video` property" );
ok( instance instanceof Popcorn, "Instance instanceof Popcorn" );
plus();
- ok( 3 === Popcorn.instances.length, "There are the correct number of Popcorn instances" );
+ equal( Popcorn.instances.length, 1, "There are the correct number of Popcorn instances" );
plus();
});