diff --git a/CHANGELOG b/CHANGELOG index a3d6487..87afc76 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Use `Prototype.emptyFunction` consistently throughout unit tests. [#253 state:resolved] (Michael M Slusarz, John David Dalton, kangax) + * deprecation extension: mark Array#reduce() as removed. [#569 state:resolved] (Tobie Langel) * `Form.serialize` now works safely with forms that have "length"-named elements. [#77 state:resolved] (Peter Adrianov, John-David Dalton, kangax) diff --git a/test/unit/ajax_test.js b/test/unit/ajax_test.js index bd59062..7848a83 100644 --- a/test/unit/ajax_test.js +++ b/test/unit/ajax_test.js @@ -96,7 +96,7 @@ new Test.Unit.Runner({ onComplete: Prototype.emptyFunction } var request = new Ajax.Updater("content", "../fixtures/hello.js", options); - request.options.onComplete = function() {}; + request.options.onComplete = Prototype.emptyFunction; this.assertIdentical(Prototype.emptyFunction, options.onComplete); }, @@ -105,7 +105,7 @@ new Test.Unit.Runner({ this.assertEqual(1, Ajax.Responders.responders.length); var dummyResponder = { - onComplete: function(req) { /* dummy */ } + onComplete: Prototype.emptyFunction }; Ajax.Responders.register(dummyResponder); @@ -376,4 +376,4 @@ new Test.Unit.Runner({ this.info(message); } } -}); \ No newline at end of file +}); diff --git a/test/unit/event_test.js b/test/unit/event_test.js index 49abde3..c399b88 100644 --- a/test/unit/event_test.js +++ b/test/unit/event_test.js @@ -138,7 +138,7 @@ new Test.Unit.Runner({ }, testStopObservingRemovesHandlerFromCache: function() { - var span = $("span"), observer = function() { }, eventID; + var span = $("span"), observer = Prototype.emptyFunction, eventID; span.observe("test:somethingHappened", observer); @@ -158,7 +158,7 @@ new Test.Unit.Runner({ }, testObserveAndStopObservingAreChainable: function() { - var span = $("span"), observer = function() { }; + var span = $("span"), observer = Prototype.emptyFunction; this.assertEqual(span, span.observe("test:somethingHappened", observer)); this.assertEqual(span, span.stopObserving("test:somethingHappened", observer)); @@ -192,7 +192,7 @@ new Test.Unit.Runner({ testEventStopped: function() { var span = $("span"), event; - span.observe("test:somethingHappened", function() { }); + span.observe("test:somethingHappened", Prototype.emptyFunction); event = span.fire("test:somethingHappened"); this.assert(!event.stopped, "event.stopped should be false with an empty observer"); span.stopObserving("test:somethingHappened");