From 70aed2d9007a7649d74ebb1f08c3bd144da99bb3 Mon Sep 17 00:00:00 2001 From: "Davis W. Frank" Date: Tue, 8 Mar 2011 18:37:44 -0800 Subject: [PATCH] move all "assertion" to "expectation" --- spec/suites/SpecRunningSpec.js | 2 +- spec/suites/TrivialConsoleReporterSpec.js | 14 +++++++------- src/console/TrivialConsoleReporter.js | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/spec/suites/SpecRunningSpec.js b/spec/suites/SpecRunningSpec.js index 289d946..706449e 100644 --- a/spec/suites/SpecRunningSpec.js +++ b/spec/suites/SpecRunningSpec.js @@ -54,7 +54,7 @@ describe("jasmine spec running", function () { this.expect(foo).toEqual('baz'); }); - specWithMultipleExpectations = env.it('spec with multiple assertions').runs(function () { + specWithMultipleExpectations = env.it('spec with multiple expectations').runs(function () { var foo = 'bar'; var baz = 'quux'; diff --git a/spec/suites/TrivialConsoleReporterSpec.js b/spec/suites/TrivialConsoleReporterSpec.js index c1ada66..37e81aa 100644 --- a/spec/suites/TrivialConsoleReporterSpec.js +++ b/spec/suites/TrivialConsoleReporterSpec.js @@ -78,7 +78,7 @@ describe("TrivialConsoleReporter", function() { green(".") + green(".") + green("."), "", "Finished in 0.777 seconds", - green("3 specs, 7 assertions, 0 failures"), + green("3 specs, 7 expectations, 0 failures"), "" ].join("\n") + "\n" ); @@ -120,7 +120,7 @@ describe("TrivialConsoleReporter", function() { "", "Finished in 0.777 seconds", - green("3 specs, 7 assertions, 0 failures"), + green("3 specs, 7 expectations, 0 failures"), "" ].join("\n") + "\n" ); @@ -182,7 +182,7 @@ describe("TrivialConsoleReporter", function() { " stack trace one", "", "Finished in 0.777 seconds", - red("3 specs, 7 assertions, 2 failures"), + red("3 specs, 7 expectations, 2 failures"), "" ].join("\n") + "\n" ); @@ -386,13 +386,13 @@ describe("TrivialConsoleReporter", function() { }); }); - describe("specs/assertions/failures summary", function(){ + describe("specs/expectations/failures summary", function(){ it("prints statistics in green if there were no failures", function() { this.reporter.reportRunnerResults({ results:function(){return {items_: [null, null, null], totalCount: 7, failedCount: 0};} }); expect(this.out.getOutput()). - toContain("3 specs, 7 assertions, 0 failures"); + toContain("3 specs, 7 expectations, 0 failures"); }); it("prints statistics in red if there was a failure", function() { @@ -400,7 +400,7 @@ describe("TrivialConsoleReporter", function() { results:function(){return {items_: [null, null, null], totalCount: 7, failedCount: 3};} }); expect(this.out.getOutput()). - toContain("3 specs, 7 assertions, 3 failures"); + toContain("3 specs, 7 expectations, 3 failures"); }); it("handles pluralization with 1's ones appropriately", function() { @@ -408,7 +408,7 @@ describe("TrivialConsoleReporter", function() { results:function(){return {items_: [null], totalCount: 1, failedCount: 1};} }); expect(this.out.getOutput()). - toContain("1 spec, 1 assertion, 1 failure"); + toContain("1 spec, 1 expectation, 1 failure"); }); }); diff --git a/src/console/TrivialConsoleReporter.js b/src/console/TrivialConsoleReporter.js index 0d35606..8b379c9 100644 --- a/src/console/TrivialConsoleReporter.js +++ b/src/console/TrivialConsoleReporter.js @@ -6,7 +6,7 @@ jasmine.TrivialConsoleReporter = function(print, doneCallback) { var defaultColumnsPerLine = 50, ansi = { green: '\033[32m', red: '\033[31m', yellow: '\033[33m', none: '\033[0m' }, - language = { spec:"spec", assertion:"assertion", failure:"failure" }; + language = { spec:"spec", expectation:"expectation", failure:"failure" }; function coloredStr(color, str) { return ansi[color] + str + ansi.none; } @@ -48,14 +48,14 @@ jasmine.TrivialConsoleReporter = function(print, doneCallback) { } function finished(elapsed) { newline(); print("Finished in " + elapsed/1000 + " seconds"); } - function summary(colorF, specs, assertions, failed) { newline(); + function summary(colorF, specs, expectations, failed) { newline(); print(colorF(specs + " " + plural(language.spec, specs) + ", " + - assertions + " " + plural(language.assertion, assertions) + ", " + + expectations + " " + plural(language.expectation, expectations) + ", " + failed + " " + plural(language.failure, failed))); newline(); newline(); } - function greenSummary(specs, assertions, failed){ summary(greenStr, specs, assertions, failed); } - function redSummary(specs, assertions, failed){ summary(redStr, specs, assertions, failed); } + function greenSummary(specs, expectations, failed){ summary(greenStr, specs, expectations, failed); } + function redSummary(specs, expectations, failed){ summary(redStr, specs, expectations, failed); }