Sha256: 138e3bb803a37dba190003b9eb272c3e8e1e5dd6656ccf86d23b22b9a0f83c17

Contents?: true

Size: 1.18 KB

Versions: 25

Compression:

Stored size: 1.18 KB

Contents

var CssClassNameTest = TestCase('CssClassName');

CssClassNameTest.prototype.setUp = function() {
  this.sanitizer_ = new webfont.CssClassName();
};

CssClassNameTest.prototype.testSanitizeSpacesInName = function() {
  var result = this.sanitizer_.sanitize(' My Family ');

  assertEquals('myfamily', result);
};

CssClassNameTest.prototype.testSanitizeNumbersInName = function() {
  var result = this.sanitizer_.sanitize('99 My Family 99');

  assertEquals('99myfamily99', result);
};

CssClassNameTest.prototype.testSanitizeOtherChars = function() {
  var result = this.sanitizer_.sanitize('_My+Family!-');

  assertEquals('myfamily', result);
};

CssClassNameTest.prototype.testBuildManyParts = function() {
  var result = this.sanitizer_.build('pre_', 'My Family', '_post');

  assertEquals('pre-myfamily-post', result);
};

CssClassNameTest.prototype.testBuildSomeParts = function() {
  var result = this.sanitizer_.build('pre!', 'My Family');

  assertEquals('pre-myfamily', result);
};

CssClassNameTest.prototype.testBuildOtherJoinChar = function() {
  this.sanitizer_ = new webfont.CssClassName('_');
  var result = this.sanitizer_.build('pre', 'My Family');

  assertEquals('pre_myfamily', result);
};

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
webfontloader-1.2.0 src-test/core/cssclassnametest.js
webfontloader-1.1.2 src-test/core/cssclassnametest.js
webfontloader-1.1.1 src-test/core/cssclassnametest.js
webfontloader-1.1.0 src-test/core/cssclassnametest.js
webfontloader-1.0.31 src-test/core/cssclassnametest.js
webfontloader-1.0.30 src-test/core/cssclassnametest.js
webfontloader-1.0.29 src-test/core/cssclassnametest.js
webfontloader-1.0.28 src-test/core/cssclassnametest.js
webfontloader-1.0.27 src-test/core/cssclassnametest.js
webfontloader-1.0.26 src-test/core/cssclassnametest.js
webfontloader-1.0.25 src-test/core/cssclassnametest.js
webfontloader-1.0.24 src-test/core/cssclassnametest.js
webfontloader-1.0.22 src-test/core/cssclassnametest.js
webfontloader-1.0.21 src-test/core/cssclassnametest.js
webfontloader-1.0.20 src-test/core/cssclassnametest.js
webfontloader-1.0.19 src-test/core/cssclassnametest.js
webfontloader-1.0.18 src-test/core/cssclassnametest.js
webfontloader-1.0.16 src-test/core/cssclassnametest.js
webfontloader-1.0.15 src-test/core/cssclassnametest.js
webfontloader-1.0.13 src-test/core/cssclassnametest.js