Sha256: b2d6c4e99d6fa9827b162718e6a29b5f61304b939bc9a0a748db74f3422d39d0

Contents?: true

Size: 1.17 KB

Versions: 15

Compression:

Stored size: 1.17 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2009 Apple Inc. and contributors.
// License:   Licened under MIT license (see license.js)
// ==========================================================================
/*global module test equals context ok same */

module('String.prototype.w()');

test("'one two three'.w() => ['one','two','three']", function() {
  same('one two three'.w(), ['one','two','three'], "should be equal");
});

test("'one    two    three'.w() with extra spaces between words => ['one','two','three']", function() {
  same('one    two    three'.w(), ['one','two','three'], "should be equal");
});

test("Trim ' spaces on both sides '", function() {
  same(' spaces on both sides '.trim(), 'spaces on both sides', "should be equal");
});

test("Trim ' spaces on both sides ' on left only", function() {
  same(' spaces on both sides '.trimLeft(), 'spaces on both sides ', "should be equal");
});

test("Trim ' spaces on both sides ' on right only", function() {
  same(' spaces on both sides '.trimRight(), ' spaces on both sides', "should be equal");
});

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sproutcore-1.0.1046 frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js
sproutcore-1.0.1043 frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js
sproutcore-1.0.1042 frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js
sproutcore-1.0.1037 frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js
sproutcore-1.0.1035 frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js
sproutcore-1.0.1031 frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js
sproutcore-1.0.1030 frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js
sproutcore-1.0.1029 frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js
sproutcore-1.0.1027 frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js
sproutcore-1.0.1028 frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js
sproutcore-1.0.1026 frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js
sproutcore-1.0.1025 frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js
sproutcore-1.0.1024 frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js
sproutcore-1.0.1009 frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js
sproutcore-1.0.1008 frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js