pivotal/jasmine — pull request #186 by ryangreenberg (2012-02-16 18:15:17+00:00)
Title: Match anything that isn't undefined with .any

This change modifies the jasmine.any argument matcher to allow it to match any object regardless of type. For example:

var fn = jasmine.createSpy();
fn("Chai", [1,2,3]);
expect(fn).toHaveBeenCalledWith(jasmine.any(String), jasmine.any()); // passes

var fn = jasmine.createSpy();
fn("Earl Grey");
expect(fn).toHaveBeenCalledWith(jasmine.any(String), jasmine.any()); // fails

I'd also be open to changing `jasmine.any()` (no args) to `jasmine.anything()`. I thought it was preferable not to introduce more terminology, but I see that `.anything()` may be more descriptive for readers than `.any()`.