Comparing version 1.1.0 to 1.1.1
@@ -43,3 +43,6 @@ 'use strict'; | ||
if (!plugin) return; | ||
if (!plugin) { | ||
this.error('Invalid command'); | ||
return this.exit(1); | ||
} | ||
@@ -46,0 +49,0 @@ var options = minimist(args.slice(1)); |
{ | ||
"name": "fredrick", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "simple module for writing your spiffy command line tools", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -325,2 +325,22 @@ var test = require('tape'); | ||
test('Fredrick handles invalid commands', function(t) { | ||
var fakeStderr = { write: sinon.spy() }; | ||
var fakeExit = sinon.spy(); | ||
var fredrick = new Fredrick('fredrick', { | ||
stderr: fakeStderr, exit: fakeExit | ||
}); | ||
var args = ['testing']; | ||
fredrick.respond(args); | ||
t.plan(2); | ||
t.ok(fakeStderr.write.calledWith('Invalid command\n'), 'writes error'); | ||
t.ok(fakeExit.calledWith(1), 'exits cleanly'); | ||
}); | ||
test('Fredrick responds to usage command', function(t) { | ||
@@ -327,0 +347,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16294
531