Skip to content

Commit

Permalink
[fix] Partially revert bc4c239. Fixes #325.
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Nov 21, 2014
1 parent 2405195 commit acbb20a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
7 changes: 4 additions & 3 deletions lib/vows.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
//
var path = require('path'),
events = require('events'),
util = require('util'),
vows = exports;

// Options
Expand Down Expand Up @@ -122,7 +123,7 @@ function addVow(vow) {
var after = vow.binding.context.after;
// only need to check order. I won't get here if the after event
// has never been emitted
if (self._vowsEmitedEventsOrder.indexOf(after) >
if (self._vowsEmitedEventsOrder.indexOf(after) >
self._vowsEmitedEventsOrder.indexOf(event)) {
output('broken', event + ' emitted before ' + after);
return;
Expand Down Expand Up @@ -184,7 +185,7 @@ process.on('exit', function () {
}
});

if (unFired.length > 0) { console.log(); }
if (unFired.length > 0) { util.print('\n'); }

unFired.forEach(function (title) {
s.reporter.report(['error', {
Expand All @@ -204,7 +205,7 @@ process.on('exit', function () {
});
});
if (failure) {
console.log(console.result(results));
util.puts(console.result(results));
process.exit(1);
}
});
Expand Down
6 changes: 4 additions & 2 deletions lib/vows/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ this.stylize = function stylize(str, style) {
if (module.exports.nocolor) {
return str;
}

var styles = {
'bold' : [1, 22],
'italic' : [3, 23],
Expand Down Expand Up @@ -52,6 +52,8 @@ this.puts = function (options) {
};
};

this.log = this.puts({});

this.result = function (event) {
var result = [], buffer = [], time = '', header;
var complete = event.honored + event.pending + event.errored + event.broken;
Expand Down Expand Up @@ -93,7 +95,7 @@ this.inspect = function inspect(val) {
if (module.exports.nocolor) {
return eyes(val);
}

return '\033[1m' + eyes(val) + '\033[22m';
};

Expand Down
2 changes: 1 addition & 1 deletion lib/vows/reporters/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ this.report = function (data) {
puts(console.vowText(event));
break;
case 'end':
console.log();
this.print('\n');
break;
case 'finish':
puts(console.result(event).join('\n'));
Expand Down
20 changes: 20 additions & 0 deletions test/experimental/gh-325.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var vows = require('./'),
assert = require('assert');

vows.describe('basic-formulation').addBatch({
"An invocation with no query string": {
topic: function() {
request.get("http://localhost:8080/something", this.callback);
},

"does not fail": function(error, response, body) {
assert.notEqual(true, error);
},

"receives a response": {
"with status 200": function(error, response, body) {
assert.equal(200, response.statusCode);
}
}
}
}).export(module);

0 comments on commit acbb20a

Please sign in to comment.