Files
jasmine/spec/core/TimerSpec.js
Sheel Choksi 4bff199c2a Rename a spy's callReturn and callThrow
.and.callReturn is now .and.returnValue
.and.callThrow is now .and.throwError

[finishes #56281634]
2013-09-06 21:55:14 -07:00

14 lines
319 B
JavaScript

describe("Timer", function() {
it("reports the time elapsed", function() {
var fakeNow = jasmine.createSpy('fake Date.now'),
timer = new j$.Timer({now: fakeNow});
fakeNow.and.returnValue(100);
timer.start();
fakeNow.and.returnValue(200);
expect(timer.elapsed()).toEqual(100);
});
});