diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 19577db8..0217df88 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -342,7 +342,7 @@ getJasmineRequireObj().Spec = function(j$) { this.onStart(this); - if (!this.isExecutable() || enabled === false) { + if (!this.isExecutable() || this.markedPending || enabled === false) { complete(enabled); return; } @@ -419,7 +419,7 @@ getJasmineRequireObj().Spec = function(j$) { }; Spec.prototype.isExecutable = function() { - return !this.disabled && !this.markedPending; + return !this.disabled; }; Spec.prototype.getFullName = function() { diff --git a/spec/core/SpecSpec.js b/spec/core/SpecSpec.js index 01cbebd8..b16d03f1 100644 --- a/spec/core/SpecSpec.js +++ b/spec/core/SpecSpec.js @@ -119,7 +119,6 @@ describe("Spec", function() { queueRunnerFactory: fakeQueueRunner }); - expect(spec.status()).toBe('pending'); }); @@ -402,13 +401,13 @@ describe("Spec", function() { expect(spec.isExecutable()).toBe(false); }); - it("should not be executable when pending", function() { + it("should be executable when pending", function() { var spec = new j$.Spec({ queueableFn: { fn: function() {} } }); spec.pend(); - expect(spec.isExecutable()).toBe(false); + expect(spec.isExecutable()).toBe(true); }); it("should be executable when not disabled or pending", function() { diff --git a/spec/core/integration/EnvSpec.js b/spec/core/integration/EnvSpec.js index de2ed90e..0dd00170 100644 --- a/spec/core/integration/EnvSpec.js +++ b/spec/core/integration/EnvSpec.js @@ -1134,6 +1134,27 @@ describe("Env integration", function() { }); expect(reporter.specDone.calls.count()).toBe(5); + + expect(reporter.specDone).toHaveBeenCalledWith(jasmine.objectContaining({ + description: 'with a top level spec', + status: 'passed' + })); + + expect(reporter.specDone).toHaveBeenCalledWith(jasmine.objectContaining({ + description: "with an x'ed spec", + status: 'pending' + })); + + expect(reporter.specDone).toHaveBeenCalledWith(jasmine.objectContaining({ + description: 'with a spec', + status: 'failed' + })); + + expect(reporter.specDone).toHaveBeenCalledWith(jasmine.objectContaining({ + description: 'is pending', + status: 'pending' + })); + var suiteResult = reporter.suiteStarted.calls.argsFor(0)[0]; expect(suiteResult.description).toEqual("A Suite"); @@ -1147,7 +1168,7 @@ describe("Env integration", function() { env.expect(true).toBe(true); }); env.describe("with a nested suite", function() { - env.xit("with a pending spec", function() { + env.xit("with an x'ed spec", function() { env.expect(true).toBe(true); }); env.it("with a spec", function() { @@ -1155,9 +1176,9 @@ describe("Env integration", function() { }); }); - env.describe('with only pending specs', function() { + env.describe('with only non-executable specs', function() { env.it('is pending'); - env.xit('is pending', function() { + env.xit('is xed', function() { env.expect(true).toBe(true); }); }); diff --git a/src/core/Spec.js b/src/core/Spec.js index 3305df11..a7235d9f 100644 --- a/src/core/Spec.js +++ b/src/core/Spec.js @@ -50,7 +50,7 @@ getJasmineRequireObj().Spec = function(j$) { this.onStart(this); - if (!this.isExecutable() || enabled === false) { + if (!this.isExecutable() || this.markedPending || enabled === false) { complete(enabled); return; } @@ -127,7 +127,7 @@ getJasmineRequireObj().Spec = function(j$) { }; Spec.prototype.isExecutable = function() { - return !this.disabled && !this.markedPending; + return !this.disabled; }; Spec.prototype.getFullName = function() {