Change test for how a spy gets its full name

- Removes another TODO
- A spec uses its full name as soon as it is created (for the result
    object) and so it needed to be tested differently
This commit is contained in:
Sheel Choksi
2013-11-04 21:37:59 -08:00
parent de6a305b44
commit 952eb59707

View File

@@ -208,15 +208,14 @@ describe("Spec", function() {
});
it("can return its full name", function() {
var spec;
spec = new j$.Spec({
getSpecName: function(passedVal) {
// expect(passedVal).toBe(spec); TODO: a exec time, spec is undefined WTF?
return 'expected val';
}
var specNameSpy = jasmine.createSpy('specNameSpy').and.returnValue('expected val');
var spec = new j$.Spec({
getSpecName: specNameSpy
});
expect(spec.getFullName()).toBe('expected val');
expect(specNameSpy).toHaveBeenCalledWith(spec);
});
describe("when a spec is marked pending during execution", function() {