From 0c6e590a939581bc0ef8528272085241cb94186a Mon Sep 17 00:00:00 2001 From: Sheel Choksi Date: Thu, 24 Oct 2013 11:33:47 -0700 Subject: [PATCH] A spec without expectations is considered passing - Specs are passing by default unless told otherwise - Getting the result.status of a spec before the spec has run is now undefined instead of pending [finishes #59422744] --- spec/core/SpecSpec.js | 13 ++----------- src/core/Spec.js | 5 +---- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/spec/core/SpecSpec.js b/spec/core/SpecSpec.js index 424f0cb2..41a514ce 100644 --- a/spec/core/SpecSpec.js +++ b/spec/core/SpecSpec.js @@ -189,18 +189,9 @@ describe("Spec", function() { expect(done).toHaveBeenCalled(); }); - it("#status returns pending by default", function() { + it("#status returns passing by default", function() { var spec = new j$.Spec({fn: jasmine.createSpy("spec body")}); - expect(spec.status()).toEqual('pending'); - }); - - it("#status returns pending if no expectations were encountered", function() { - var specBody = jasmine.createSpy("spec body"), - spec = new j$.Spec({fn: specBody}); - - spec.execute(); - - expect(spec.status()).toEqual('pending'); + expect(spec.status()).toEqual('passed'); }); it("#status returns passed if all expectations in the spec have passed", function() { diff --git a/src/core/Spec.js b/src/core/Spec.js index 155fcf06..450dc7b5 100644 --- a/src/core/Spec.js +++ b/src/core/Spec.js @@ -1,6 +1,5 @@ getJasmineRequireObj().Spec = function(j$) { function Spec(attrs) { - this.encounteredExpectations = false; this.expectationFactory = attrs.expectationFactory; this.resultCallback = attrs.resultCallback || function() {}; this.id = attrs.id; @@ -26,13 +25,11 @@ getJasmineRequireObj().Spec = function(j$) { id: this.id, description: this.description, fullName: this.getFullName(), - status: this.status(), failedExpectations: [] }; } Spec.prototype.addExpectationResult = function(passed, data) { - this.encounteredExpectations = true; if (passed) { return; } @@ -118,7 +115,7 @@ getJasmineRequireObj().Spec = function(j$) { return 'disabled'; } - if (this.markedPending || !this.encounteredExpectations) { + if (this.markedPending) { return 'pending'; }