Permalink
Browse files

allow format to be specified on command line

  • Loading branch information...
refractalize committed Mar 3, 2012
1 parent fc6296b commit 6dbc9f85f745cebad96fd5a822b6d224798bd0ae
Showing with 7 additions and 1 deletion.
  1. +7 −1 cupoftea.js
View
@@ -1,5 +1,6 @@
var _ = require('underscore');
var util = require('util');
+var argv = require('optimist').argv;
var debug = function (msg) {
//console.log(msg);
@@ -308,7 +309,12 @@ var RspecResults = function () {
};
};
-var results = new SimpleResults();
+var resultFormatters = {
+ 'simple': SimpleResults,
+ 'rspec': RspecResults
+};
+
+var results = new (resultFormatters[argv.format || 'rspec'])();
var TopLevelRunStack = function () {
this.spec = function (desc, definition) {

0 comments on commit 6dbc9f8

Please sign in to comment.