diff options
author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-09 00:56:48 +0000 |
---|---|---|
committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-09 00:56:48 +0000 |
commit | 5728887b62634a0357a574d688ffeba697838d27 (patch) | |
tree | 11b1bb1891660d4c1be6ad422c16d3336a532090 /js/tests | |
parent | bcbea78bf91718bdc71c0ccf34a63015bbc872a7 (diff) | |
download | elgg-5728887b62634a0357a574d688ffeba697838d27.tar.gz elgg-5728887b62634a0357a574d688ffeba697838d27.tar.bz2 |
Using nullFunction + abstractMethod reference instead of new closures in EventsTest
git-svn-id: http://code.elgg.org/elgg/trunk@7266 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'js/tests')
-rw-r--r-- | js/tests/ElggEventsTest.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/js/tests/ElggEventsTest.js b/js/tests/ElggEventsTest.js index cc30e8418..1fc9c8e86 100644 --- a/js/tests/ElggEventsTest.js +++ b/js/tests/ElggEventsTest.js @@ -5,24 +5,24 @@ ElggEventsTest.prototype.setUp = function() { elgg.provide('elgg.config.events.all.all'); }; -ElggEventsTest.prototype.testEventHandlersMustBeFunctions = function() { +ElggEventsTest.prototype.testEventHandlersMustBeFunctions = function () { assertException(function() { elgg.register_event_handler('str', 'str', 'oops'); }); }; -ElggEventsTest.prototype.testReturnValueDefaultsToTrue = function() { +ElggEventsTest.prototype.testReturnValueDefaultsToTrue = function () { assertTrue(elgg.trigger_event('fee', 'fum')); - elgg.register_event_handler('fee', 'fum', function() {}); + elgg.register_event_handler('fee', 'fum', elgg.nullFunction); assertTrue(elgg.trigger_event('fee', 'fum')); }; -ElggEventsTest.prototype.testCanGlomEventsWithAll = function() { - elgg.register_event_handler('all', 'bar', function() { throw new Error(); }); +ElggEventsTest.prototype.testCanGlomEventsWithAll = function () { + elgg.register_event_handler('all', 'bar', elgg.abstractMethod); assertException("all,bar", function() { elgg.trigger_event('foo', 'bar'); }); - elgg.register_event_handler('foo', 'all', function() { throw new Error(); }); + elgg.register_event_handler('foo', 'all', elgg.abstractMethod); assertException("foo,all", function() { elgg.trigger_event('foo', 'baz'); }); - elgg.register_event_handler('all', 'all', function() { throw new Error(); }); + elgg.register_event_handler('all', 'all', elgg.abstractMethod); assertException("all,all", function() { elgg.trigger_event('pinky', 'winky'); }); };
\ No newline at end of file |