failing spec makes a red dot

This commit is contained in:
Steve Conover
2011-02-28 13:45:22 -08:00
parent 528b5abeda
commit 945a9ba638
2 changed files with 23 additions and 5 deletions

View File

@@ -1,13 +1,13 @@
describe("TrivialNodeReporter", function() {
var green = function(str) {
function green(str) {
return '\033[32m' + str + '\033[0m'; //keep these literal. otherwise the test loses value as a test.
};
}
var red = function(str) {
function red(str) {
return '\033[31m' + str + '\033[0m';
};
}
var newline = "\n";
@@ -63,6 +63,19 @@ describe("TrivialNodeReporter", function() {
);
});
it("prints a red dot if the spec fails", function(){
var failingSpec = {
results: function(){
return {passed:function(){return false;}};
}
};
this.reporter.reportSpecResults(failingSpec);
expect(this.fakeSys.getOutput()).toEqual(
red(".")
);
});
});
});