Skip to content

Commit

Permalink
Removed duplication; Merged PR #4; Added framework for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
stiang committed Mar 18, 2014
1 parent 75a9795 commit b36de78
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 18 deletions.
16 changes: 8 additions & 8 deletions index.js
Expand Up @@ -13,14 +13,14 @@ var r = require('rethinkdb'),
.boolean(['c', 'colors', 'j', 'n', 'r', 'v'])
.default('colors', true)
.default('file', defaultConfigFile)
.alias('c', 'coffee')
.alias('d', 'database')
.alias('f', 'file')
.alias('h', 'host')
.alias('j', 'json')
.alias('p', 'port')
.alias('r', 'raw')
.alias('v', 'version')
.alias('coffee', 'c')
.alias('database', 'd')
.alias('file', 'f')
.alias('host', 'h')
.alias('json', 'j')
.alias('port', 'p')
.alias('raw', 'r')
.alias('version', 'v')
.argv;

var writer = function(rawResult) {
Expand Down
16 changes: 8 additions & 8 deletions lib/misc.js
Expand Up @@ -66,14 +66,14 @@ exports.replEval = function(code, context, file, cb) {
};

exports.setupOptions = function(rawOpts, globalSettings, userSettings) {
var defaults = {c: false, coffee: false,
d: 'test', database: 'test',
h: 'localhost', host: 'localhost',
p: 28015, port: 28015,
n: false, colors: true,
j: false, json: false,
r: false, raw: false,
v: false, version: false};
var defaults = { coffee: false,
database: 'test',
host: 'localhost',
port: 28015,
colors: true,
json: false,
raw: false,
version: false };

if (rawOpts.n) rawOpts.colors = false;

Expand Down
10 changes: 8 additions & 2 deletions package.json
Expand Up @@ -12,7 +12,9 @@
"js-yaml": "3.0.x",
"repl.history": "0.1.x"
},
"devDependencies": {},
"devDependencies": {
"mocha": "1.12.x"
},
"bin": {
"recli": "./bin/recli.js"
},
Expand Down Expand Up @@ -45,5 +47,9 @@
{
"name": "StreetStrider"
}
]
],
"scripts": {
"test": "mocha -R spec ./test.js"
}

}
12 changes: 12 additions & 0 deletions test.js
@@ -0,0 +1,12 @@
// This package is getting quite useful, but needs some tests!
// Please contribute if you can.

var assert = require('assert');

describe('package', function () {

it('should have basic tests', function() {
assert.ok(false);
});

});

0 comments on commit b36de78

Please sign in to comment.