From 8d94d0bfc546aebbb69fbb3c5b06c75299467551 Mon Sep 17 00:00:00 2001 From: "Davis W. Frank & Rajan Agaskar" Date: Thu, 29 Nov 2012 12:17:20 -0800 Subject: [PATCH] Move ExpectationResult into its own file --- lib/jasmine-core/jasmine.js | 39 +++++++++++++++++------------------ src/core/ExpectationResult.js | 19 +++++++++++++++++ src/core/base.js | 20 ------------------ tasks/jasmine_dev/sources.rb | 1 + 4 files changed, 39 insertions(+), 40 deletions(-) create mode 100644 src/core/ExpectationResult.js diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 8ce280bb..b7bbbee9 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -102,26 +102,6 @@ jasmine.MessageResult.prototype.toString = function() { return text; }; -jasmine.ExpectationResult = function(params) { - this.type = 'expect'; - this.matcherName = params.matcherName; - this.passed_ = params.passed; - this.expected = params.expected; - this.actual = params.actual; - this.message = this.passed_ ? 'Passed.' : params.message; - - var trace = (params.trace || new Error(this.message)); - this.trace = this.passed_ ? '' : trace; -}; - -jasmine.ExpectationResult.prototype.toString = function () { - return this.message; -}; - -jasmine.ExpectationResult.prototype.passed = function () { - return this.passed_; -}; - /** * Getter for the Jasmine environment. Ensures one gets created */ @@ -528,6 +508,25 @@ jasmine.util.extend = function(destination, source) { return destination; }; +jasmine.ExpectationResult = function(params) { + this.type = 'expect'; + this.matcherName = params.matcherName; + this.passed_ = params.passed; + this.expected = params.expected; + this.actual = params.actual; + this.message = this.passed_ ? 'Passed.' : params.message; + + var trace = (params.trace || new Error(this.message)); + this.trace = this.passed_ ? '' : trace; +}; + +jasmine.ExpectationResult.prototype.toString = function () { + return this.message; +}; + +jasmine.ExpectationResult.prototype.passed = function () { + return this.passed_; +}; /** * Environment for Jasmine * diff --git a/src/core/ExpectationResult.js b/src/core/ExpectationResult.js new file mode 100644 index 00000000..39ac68ef --- /dev/null +++ b/src/core/ExpectationResult.js @@ -0,0 +1,19 @@ +jasmine.ExpectationResult = function(params) { + this.type = 'expect'; + this.matcherName = params.matcherName; + this.passed_ = params.passed; + this.expected = params.expected; + this.actual = params.actual; + this.message = this.passed_ ? 'Passed.' : params.message; + + var trace = (params.trace || new Error(this.message)); + this.trace = this.passed_ ? '' : trace; +}; + +jasmine.ExpectationResult.prototype.toString = function () { + return this.message; +}; + +jasmine.ExpectationResult.prototype.passed = function () { + return this.passed_; +}; diff --git a/src/core/base.js b/src/core/base.js index 0a567acd..a5809697 100644 --- a/src/core/base.js +++ b/src/core/base.js @@ -102,26 +102,6 @@ jasmine.MessageResult.prototype.toString = function() { return text; }; -jasmine.ExpectationResult = function(params) { - this.type = 'expect'; - this.matcherName = params.matcherName; - this.passed_ = params.passed; - this.expected = params.expected; - this.actual = params.actual; - this.message = this.passed_ ? 'Passed.' : params.message; - - var trace = (params.trace || new Error(this.message)); - this.trace = this.passed_ ? '' : trace; -}; - -jasmine.ExpectationResult.prototype.toString = function () { - return this.message; -}; - -jasmine.ExpectationResult.prototype.passed = function () { - return this.passed_; -}; - /** * Getter for the Jasmine environment. Ensures one gets created */ diff --git a/tasks/jasmine_dev/sources.rb b/tasks/jasmine_dev/sources.rb index a9f5abaa..671d5307 100644 --- a/tasks/jasmine_dev/sources.rb +++ b/tasks/jasmine_dev/sources.rb @@ -3,6 +3,7 @@ class JasmineDev < Thor :core => [ "base.js", "util.js", + "ExpectationResult.js", "Env.js", "Reporter.js", "Block.js",