]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
fixed merge conflicts, fixed leaking var in unit tests
authorChristopher De Cairos <chris.decairos@gmail.com>
Tue, 7 Jun 2011 16:29:21 +0000 (12:29 -0400)
committerChristopher De Cairos <chris.decairos@gmail.com>
Tue, 7 Jun 2011 16:29:21 +0000 (12:29 -0400)
1  2 
test/popcorn.unit.js

index a6041d68695f54a325530f2a26a1eeb846a69e8c,71d84cef1d88d57c52c9dc4b0eb290f2d4eb6b7b..ab2c99b6ae60ff088c07add0d87fcf315e65f0bf
@@@ -464,88 -492,6 +494,86 @@@ test("exec", function () 
  
  });
  
- test("Popcorn.extend", function () {
++test( "Popcorn.extend", function () {
 +  
 +  QUnit.reset();
 +  
 +  expect( 12 );
 +  
 +  var dest = {},
 +      obj1 = {
 +        "key11" : "value",
 +        "key12" : 9001,
 +        "key13" : function() { return true; }
 +      },
 +      obj2 = {
 +        "key21" : "String",
 +        "key22" : 9002,
 +        "key23" : function() { return false; }
-       };
-       
-   Popcorn.extend(dest, obj1);
++      },
++      obj3 = Popcorn.extend(dest, obj1);
 +  
 +  for ( prop in obj1 ) {
 +    equal ( dest.hasOwnProperty( prop ), true, "{dest} has property: " + prop );
 +  }
 +  
 +  equal ( typeof dest["key13"], "function","dest[key13] is a function");
 +  
 +  dest = {};
 +  
-   Popcorn.extend( dest, obj1, obj2 );
++  obj3 = Popcorn.extend( dest, obj1, obj2 );
 +  
-   for ( prop in obj1 ) {
++  for ( var prop in obj1 ) {
 +    equal ( dest.hasOwnProperty( prop ), true, "{dest} has property: " + prop + ", when extending 2 objects" );
 +  }
 +
-   for ( prop in obj2 ) {
++  for ( var prop in obj2 ) {
 +    equal ( dest.hasOwnProperty( prop ), true, "{dest} has property: " + prop + ", when extending 2 objects" );
 +  }
 +  
 +  equal ( typeof dest["key13"], "function","dest[key13] is a function");
 +  
 +  equal ( typeof dest["key23"], "function","dest[key23] is a function");
 +  
-   delete dest;
 +});
- /*
++
 +test( "Popcorn.events", function() {
 +
 +  QUnit.reset()
 +  expect(43);
 +  
 +  var eventTypes = [ "UIEvents", "MouseEvents", "Events" ], 
 +      natives = "", 
 +      events, 
 +      eventsReturned,
 +      idx = 0,
 +      len,
 +      okay = true;
 +
 +  eventTypes.forEach (function( e ) {
 +    ok(Popcorn.Events[e], e + " Exists")
 +  });
 +
 +  natives = Popcorn.Events[eventTypes[0]] + " " + Popcorn.Events[eventTypes[1]] + " " + Popcorn.Events[eventTypes[2]];
 +  events = natives.split( /\s+/g );
 +  eventsReturned = Popcorn.events.all;
 +  len = events.length;
 +
 +  for ( ; idx++ < len ; ) {
 +    okay = events[idx] === eventsReturned[idx];
 +  }
 +
 +  ok( okay, "Native events are correctly being handled");
 +
 +  equals( typeof Popcorn.Events.Natives, "string", "Popcorn.Events.Natives is an object" );
 +  equals( typeof Popcorn.events, "object", "Popcorn.events is an object" );
 +
 +  Popcorn.forEach( eventsReturned, function ( e ) {
 +    ok (Popcorn.events.isNative ( e ), e + " is a native event");
 +  });
 +
- });*/
++});
 +
  module("Popcorn Position");
  test("position", function () {