Permalink
Browse files

Add test for required/optional argument difference.

  • Loading branch information...
1 parent 20eabcc commit 0f51d55e9316293e245e4dcb6a1ab85c4251abee @calmh calmh committed Jun 14, 2012
Showing with 22 additions and 0 deletions.
  1. +22 −0 test/usage.js
View
@@ -91,3 +91,25 @@ exports.testHidden = function(test) {
})
.parse(["-h"]);
}
+
+exports.testRequiredOptional = function(test) {
+ test.expect(1);
+
+ nomnom().options({
+ foo: {
+ position: 0,
+ required: true,
+ help: 'The foo'
+ },
+ bar: {
+ position: 1,
+ help: 'The bar'
+ }
+ })
+ .scriptName("test")
+ .printer(function(string) {
+ test.equal(strip("Usage:test<foo>[bar]fooThefoobarThebar"), strip(string))
+ test.done();
+ })
+ .parse(["-h"]);
+}

0 comments on commit 0f51d55

Please sign in to comment.