Skip to content

Commit

Permalink
Fixed failing test for jQuery.extend
Browse files Browse the repository at this point in the history
  • Loading branch information
wagenet committed Feb 27, 2012
1 parent 1a998e8 commit ced9bb2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/ember-metal/tests/utils/meta_test.js
Expand Up @@ -44,12 +44,18 @@ test("getMeta and setMeta", function() {
if (window.jQuery) {
// Tests fix for https://github.com/emberjs/ember.js/issues/344
// This is primarily for older browsers such as IE8
// We would use NativeArray but it's not defined in metal
test("jQuery.extend works on an extended Array", function() {
var mixin = Ember.Mixin.create({ prop: 'val' })
array = mixin.apply([1,2,3]),
var array = [1,2,3],
result = {};


// Apply a mixin to an array so we can check the behavior of extended arrays
// Since prototypes may not be extended and NativeArray isn't defined in metal, we have an alternate mixin
if (!Ember.NativeArray || !Ember.NativeArray.detect(array)) {
var mixin = Ember.Mixin.create({ prop: 'val' });
array = mixin.apply(array);
}

jQuery.extend(true, result, { arr: array });

equals(result.arr.length, 3);
Expand Down

0 comments on commit ced9bb2

Please sign in to comment.