Sha256: 32b0a94ada41e577cae884c7225bfb4ce673b0429364edf2727b28f68c31d80b

Contents?: true

Size: 1.41 KB

Versions: 11

Compression:

Stored size: 1.41 KB

Contents

// ==========================================================================
// Project:   SproutCore Costello - Property Observing Library
// Copyright: ©2006-2010 Sprout Systems, Inc. and contributors.
//            Portions ©2008-2010 Apple Inc. All rights reserved.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

/*globals module test ok equals same CoreTest */

sc_require('debug/test_suites/array/base');

SC.ArraySuite.define(function(T) {
  
  var observer, obj ;
  
  module(T.desc("removeObject"), {
    setup: function() {
      obj = T.newObject();
      observer = T.observer(obj);
    }
  });

  test("should return receiver", function() {
    obj = T.newObject(3);
    equals(obj.removeObject(obj.objectAt(0)), obj, 'should return receiver');
  });
  
  test("[A,B,C].removeObject(B) => [A,C] + notify", function() {

    var before = T.expected(3),
        after  = [before[0], before[2]];
    obj.replace(0,0, before);
    observer.observe('[]', 'length') ;
    
    obj.removeObject(before[1]) ;
    T.validateAfter(obj, after, observer, YES);
  });
  
  test("[A,B,C].removeObject(D) => [A,B,C]", function() {
    var exp = T.expected(4),
        extra = exp.pop();
    obj.replace(0,0,exp);
    observer.observe('[]', 'length') ;
    
    obj.removeObject(extra);
    T.validateAfter(obj, exp, observer, NO, NO);
  });
  
});

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
sproutcore-1.4.4-java lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js
sproutcore-1.4.4 lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js
sproutcore-1.4.3.1 lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js
sproutcore-1.4.3-java lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js
sproutcore-1.4.3 lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js
sproutcore-1.4.2-java lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js
sproutcore-1.4.2 lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js
sproutcore-1.4.1-java lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js
sproutcore-1.4.1 lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js
sproutcore-1.4.0-java lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js
sproutcore-1.4.0 lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js