removing expectation count from TCR to match browser reporter

This commit is contained in:
Davis W. Frank
2011-06-08 18:36:58 -07:00
parent 86b095e5a4
commit 9d5470ff55
2 changed files with 12 additions and 14 deletions

View File

@@ -140,7 +140,7 @@ describe("TrivialConsoleReporter", function() {
green(".") + green(".") + green("."),
"",
"Finished in 0.777 seconds",
green("3 specs, 7 expectations, 0 failures"),
green("3 specs, 0 failures"),
""
].join("\n") + "\n"
);
@@ -185,7 +185,7 @@ describe("TrivialConsoleReporter", function() {
"",
"Finished in 0.777 seconds",
green("3 specs, 7 expectations, 0 failures"),
green("3 specs, 0 failures"),
""
].join("\n") + "\n"
);
@@ -251,7 +251,7 @@ describe("TrivialConsoleReporter", function() {
" stack trace one",
"",
"Finished in 0.777 seconds",
red("3 specs, 7 expectations, 2 failures"),
red("3 specs, 2 failures"),
""
].join("\n") + "\n"
);
@@ -441,7 +441,7 @@ describe("TrivialConsoleReporter", function() {
}
});
expect(out.getOutput()).
toContain("3 specs, 7 expectations, 0 failures");
toContain("3 specs, 0 failures");
});
it("prints statistics in red if there was a failure", function() {
@@ -454,7 +454,7 @@ describe("TrivialConsoleReporter", function() {
}
});
expect(out.getOutput()).
toContain("3 specs, 7 expectations, 3 failures");
toContain("3 specs, 3 failures");
});
it("handles pluralization with 1's ones appropriately", function() {
@@ -467,7 +467,7 @@ describe("TrivialConsoleReporter", function() {
}
});
expect(out.getOutput()).
toContain("1 spec, 1 expectation, 1 failure");
toContain("1 spec, 1 failure");
});
});

View File

@@ -12,7 +12,6 @@ jasmine.TrivialConsoleReporter = function(print, doneCallback) {
},
language = {
spec: "spec",
expectation: "expectation",
failure: "failure"
};
@@ -89,21 +88,20 @@ jasmine.TrivialConsoleReporter = function(print, doneCallback) {
print("Finished in " + elapsed / 1000 + " seconds");
}
function summary(colorF, specs, expectations, failed) {
function summary(colorF, specs, failed) {
newline();
print(colorF(specs + " " + plural(language.spec, specs) + ", " +
expectations + " " + plural(language.expectation, expectations) + ", " +
failed + " " + plural(language.failure, failed)));
newline();
newline();
}
function greenSummary(specs, expectations, failed) {
summary(greenStr, specs, expectations, failed);
function greenSummary(specs, failed) {
summary(greenStr, specs, failed);
}
function redSummary(specs, expectations, failed) {
summary(redStr, specs, expectations, failed);
function redSummary(specs, failed) {
summary(redStr, specs, failed);
}
function fullSuiteDescription(suite) {
@@ -173,7 +171,7 @@ jasmine.TrivialConsoleReporter = function(print, doneCallback) {
var results = runner.results();
var summaryFunction = results.failedCount === 0 ? greenSummary : redSummary;
summaryFunction(runner.specs().length, results.totalCount, results.failedCount);
summaryFunction(runner.specs().length, results.failedCount);
doneCallback(runner);
};
};