From d60786a06c19de24798b156533ee0c411832df8c Mon Sep 17 00:00:00 2001 From: Sheel Choksi Date: Mon, 29 Jul 2013 22:04:08 -0700 Subject: [PATCH] More clearly differentiate between spec and suite ids --- lib/jasmine-core/jasmine.js | 4 ++-- spec/core/EnvSpec.js | 6 +++--- spec/core/SpecRunningSpec.js | 12 ++++++------ src/core/Env.js | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 0af3ec06..7882ca71 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -629,12 +629,12 @@ getJasmineRequireObj().Env = function(j$) { // TODO: move this to closure Env.prototype.nextSpecId = function() { - return this.nextSpecId_++; + return 'spec' + this.nextSpecId_++; }; // TODO: move this to closure Env.prototype.nextSuiteId = function() { - return this.nextSuiteId_++; + return 'suite' + this.nextSuiteId_++; }; // TODO: move this to closure diff --git a/spec/core/EnvSpec.js b/spec/core/EnvSpec.js index cdf0ce76..7b910a0e 100644 --- a/spec/core/EnvSpec.js +++ b/spec/core/EnvSpec.js @@ -8,9 +8,9 @@ describe("Env", function() { describe('ids', function() { it('nextSpecId should return consecutive integers, starting at 0', function() { - expect(env.nextSpecId()).toEqual(0); - expect(env.nextSpecId()).toEqual(1); - expect(env.nextSpecId()).toEqual(2); + expect(env.nextSpecId()).toEqual('spec0'); + expect(env.nextSpecId()).toEqual('spec1'); + expect(env.nextSpecId()).toEqual('spec2'); }); }); diff --git a/spec/core/SpecRunningSpec.js b/spec/core/SpecRunningSpec.js index e67655bd..0b563ca2 100644 --- a/spec/core/SpecRunningSpec.js +++ b/spec/core/SpecRunningSpec.js @@ -25,11 +25,11 @@ describe("jasmine spec running", function () { }); }); - expect(it0.id).toEqual(0); - expect(it1.id).toEqual(1); - expect(it2.id).toEqual(2); - expect(it3.id).toEqual(3); - expect(it4.id).toEqual(4); + expect(it0.id).toEqual('spec0'); + expect(it1.id).toEqual('spec1'); + expect(it2.id).toEqual('spec2'); + expect(it3.id).toEqual('spec3'); + expect(it4.id).toEqual('spec4'); }); it('nested suites', function (done) { @@ -305,4 +305,4 @@ describe("jasmine spec running", function () { )); }); -}); \ No newline at end of file +}); diff --git a/src/core/Env.js b/src/core/Env.js index dadeeec6..ae1cee92 100644 --- a/src/core/Env.js +++ b/src/core/Env.js @@ -259,12 +259,12 @@ getJasmineRequireObj().Env = function(j$) { // TODO: move this to closure Env.prototype.nextSpecId = function() { - return this.nextSpecId_++; + return 'spec' + this.nextSpecId_++; }; // TODO: move this to closure Env.prototype.nextSuiteId = function() { - return this.nextSuiteId_++; + return 'suite' + this.nextSuiteId_++; }; // TODO: move this to closure