From 8c4fe01968aecea2ccfe6146ff580a272750e4d7 Mon Sep 17 00:00:00 2001 From: ewinslow Date: Tue, 9 Nov 2010 01:00:12 +0000 Subject: Renamed test method appropriately. jslinted ElggLibTest. git-svn-id: http://code.elgg.org/elgg/trunk@7267 36083f99-b078-4883-b0ff-0f9b5a30f544 --- js/tests/ElggLibTest.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'js/tests/ElggLibTest.js') diff --git a/js/tests/ElggLibTest.js b/js/tests/ElggLibTest.js index 035b60325..e810a47fb 100644 --- a/js/tests/ElggLibTest.js +++ b/js/tests/ElggLibTest.js @@ -15,7 +15,7 @@ ElggLibTest.prototype.testAssertTypeOf = function() { ['boolean', false], ['undefined', undefined], ['number', 0], - ['function', function() {}], + ['function', elgg.nullFunction], ]; for (var i in noexceptions) { @@ -26,7 +26,7 @@ ElggLibTest.prototype.testAssertTypeOf = function() { var exceptions = [ ['function', {}], - ['object', function() {}], + ['object', elgg.nullFunction], ]; for (var i in exceptions) { @@ -50,19 +50,23 @@ ElggLibTest.prototype.testProvide = function() { assertEquals(str, foo.bar.baz.oof); }; -ElggLibTest.prototype.testRequire = function() { - /* Try requiring bogus input */ +/** + * Try requiring bogus input + */ +ElggLibTest.prototype.testRequire = function () { assertException(function(){ elgg.require(''); }); assertException(function(){ elgg.require('garbage'); }); assertException(function(){ elgg.require('gar.ba.ge'); }); - assertNoException(function(){ elgg.require('jQuery'); }); - assertNoException(function(){ elgg.require('elgg'); }); - assertNoException(function(){ elgg.require('elgg.config'); }); - assertNoException(function(){ elgg.require('elgg.security'); }); + assertNoException(function(){ + elgg.require('jQuery'); + elgg.require('elgg'); + elgg.require('elgg.config'); + elgg.require('elgg.security'); + }); }; -ElggLibTest.prototype.testInherit = function() { +ElggLibTest.prototype.testInherit = function () { function Base() {} function Child() {} @@ -72,7 +76,7 @@ ElggLibTest.prototype.testInherit = function() { assertEquals(Child, Child.prototype.constructor); }; -ElggLibTest.prototype.testExtendUrl = function() { +ElggLibTest.prototype.testNormalizeUrl = function() { elgg.config.wwwroot = "http://elgg.org/"; var inputs = [ -- cgit v1.2.3