pivotal/jasmine — pull request #455 by jalopez (2013-10-25 13:12:47+00:00)
Title: Mock date object when installing mock clock.

Closes #361

This pull adds a new object called MockDate with mimics a date object and can be used to run synchronously tests that depends on current time. It is integrated with mock clock and can be used jointly with setTimeout and setInterval functions (if they use the Date object, it will be the mocked one).

To use it, the spec must install the mock clock but passing an argument (either a date or true). This argument represents the time reference in which tests starts. If its the boolean true, current time will be taken as reference.

Usage:

```
jasmine.clock.install(true);
var now = new Date().getTime()
jasmine.clock.tick(100);
expect(Date.now() - now).toEqual(100);
```