From 952eb59707707de922e5d8b37338f7e56f76f3ec Mon Sep 17 00:00:00 2001 From: Sheel Choksi Date: Mon, 4 Nov 2013 21:37:59 -0800 Subject: [PATCH] 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 --- spec/core/SpecSpec.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spec/core/SpecSpec.js b/spec/core/SpecSpec.js index 41a514ce..64e084af 100644 --- a/spec/core/SpecSpec.js +++ b/spec/core/SpecSpec.js @@ -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() {