Skip to content

Commit

Permalink
[fix] Dont always append a tailing \n to all test output
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Aug 12, 2011
1 parent 67b7ce7 commit 0d8c406
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions lib/vows/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var $ = this.$ = function (str) {
this.puts = function (options) {
var stylize = exports.stylize;
options.stream || (options.stream = process.stdout);
options.tail = options.tail || '';

return function (args) {
args = Array.prototype.slice.call(arguments);
Expand All @@ -42,7 +43,7 @@ this.puts = function (options) {
.replace(/\*([^*]+)\*/g, function (_, capture) { return stylize(capture, 'bold') });
});
}
return options.stream.write(args.join('\n') + '\n');
return options.stream.write(args.join('\n') + options.tail);
};
};

Expand Down Expand Up @@ -78,7 +79,7 @@ this.result = function (event) {
time = ' (' + event.time.toFixed(3) + 's)';
time = this.stylize(time, 'grey');
}
buffer.push(header + result + time);
buffer.push(header + result + time + '\n');

return buffer;
};
Expand Down
4 changes: 2 additions & 2 deletions lib/vows/reporters/dot-matrix.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var options = {},
var options = { tail: '' },
console = require('../../vows/console'),
spec = require('./spec'),
//spec = require('./spec'),
stylize = console.stylize,
puts = console.puts(options);
//
Expand Down
2 changes: 1 addition & 1 deletion lib/vows/reporters/json.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var options = {raw: true};
var options = { tail: '\n', raw: true };
var console = require('../../vows/console');
var puts = console.puts(options);

Expand Down
2 changes: 1 addition & 1 deletion lib/vows/reporters/spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var sys = require('sys');

var options = {};
var options = { tail: '\n' };
var console = require('../../vows/console');
var stylize = console.stylize,
puts = console.puts(options);
Expand Down

0 comments on commit 0d8c406

Please sign in to comment.