Use `Prototype.emptyFunction` consistently throughout unit tests. [#253 state:resolved]

This commit is contained in:
Juriy Zaytsev 2009-03-24 07:59:32 -04:00
parent b8635ebdde
commit d4c182c03d
3 changed files with 8 additions and 6 deletions

View File

@ -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)

View File

@ -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);
}
}
});
});

View File

@ -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");