Merge branch 'fix-clock-date' of https://github.com/andrewiggins/jasmine into andrewiggins-fix-clock-date

Fixes #915
Merges #980
This commit is contained in:
Gregg Van Hove
2015-12-22 14:49:18 -08:00
4 changed files with 42 additions and 6 deletions

View File

@@ -251,5 +251,18 @@ describe("DelayedFunctionScheduler", function() {
expect(fn).toHaveBeenCalled();
expect(fn.calls.count()).toBe(1);
});
it("updates the mockDate per scheduled time", function () {
var scheduler = new jasmineUnderTest.DelayedFunctionScheduler(),
tickDate = jasmine.createSpy('tickDate');
scheduler.scheduleFunction(function() {});
scheduler.scheduleFunction(function() {}, 1);
scheduler.tick(1, tickDate);
expect(tickDate).toHaveBeenCalledWith(0);
expect(tickDate).toHaveBeenCalledWith(1);
})
});