velesin/jasmine-jquery — pull request #86 by skilldrick (2012-07-26 18:28:47+00:00)
Title: Allow support for spying on document for events.

Currently,

spyOnEvent(document, 'eventName');

doesn't work, because the code:

$(selector).selector;

returns `''` when `selector` is `document`. This branch changes the above to:

$(selector).selector || selector;

which will return the original `document` object if the jQuery code returns an empty string. I moved this code into a helper function and added a few specs to test this new behaviour.