Permalink
Browse files

code cleanup, related to #40

  • Loading branch information...
puzrin committed Feb 4, 2013
1 parent e9ee3a9 commit ccd1df238086ff76371b176ca479a9836c1b4005
Showing with 168 additions and 397 deletions.
  1. +2 −6 test/base.js
  2. +1 −1 test/childgroups.js
  3. +4 −8 test/group.js
  4. +76 −168 test/nargs.js
  5. +52 −156 test/optionals.js
  6. +10 −14 test/positionals.js
  7. +11 −30 test/prefix.js
  8. +1 −1 test/sub_commands.js
  9. +5 −11 test/suppress.js
  10. +6 −2 test/user_defined_type.js
View
@@ -229,12 +229,8 @@ describe('base', function () {
// was giving: Error: _mocha: error: Unrecognized arguments: X.
});
- it('TestEmptyAndSpaceContainingArguments', function () {
- parser = new ArgumentParser({
- debug: true,
- prog: 'TestEmptyAndSpaceContainingArguments',
- description: null
- });
+ it('test empty and space containing arguments', function () {
+ parser = new ArgumentParser({debug: true});
parser.addArgument([ 'x' ], { nargs: '?' });
parser.addArgument([ '-y', '--yyy' ], { dest: 'y' });
View
@@ -7,7 +7,7 @@ var assert = require('assert');
var ArgumentParser = require('../lib/argparse').ArgumentParser;
-describe('chaild group', function () {
+describe('child group', function () {
var args;
var parentParser, group, xgroup, childParser;
View
@@ -1,4 +1,4 @@
-/*global describe, it, beforeEach*/
+/*global describe, it*/
'use strict';
@@ -13,10 +13,6 @@ describe('group', function () {
var group;
var group1;
var group2;
- beforeEach(function () {
- // parser = new ArgumentParser({prog: 'PROG', addHelp: false, debug: true});
- // parser.addArgument([ '-f', '--foo' ]);
- });
it('group test', function () {
parser = new ArgumentParser({prog: 'PROG', addHelp: false, debug: true});
@@ -29,7 +25,7 @@ describe('group', function () {
assert(group._groupActions.length, 2);
});
- it('2 group test', function () {
+ it('2 groups test', function () {
parser = new ArgumentParser({prog: 'PROG', addHelp: false, debug: true});
group1 = parser.addArgumentGroup({title: 'group1', description: 'group1 description'});
group1.addArgument(['foo'], {help: 'foo help'});
@@ -60,7 +56,7 @@ describe('group', function () {
assert.equal(args.foo || args.bar, false);
});
- it('mutually exclusive group test', function () {
+ it('mutually exclusive group test (2)', function () {
parser = new ArgumentParser({prog: 'PROG', debug: true});
group = parser.addMutuallyExclusiveGroup();
group.addArgument(['--foo'], {action: 'storeTrue'});
@@ -87,7 +83,7 @@ describe('group', function () {
);
});
- it('mutually exclusive group test', function () {
+ it('mutually exclusive group test (3)', function () {
parser = new ArgumentParser({prog: 'PROG', debug: true});
group = parser.addMutuallyExclusiveGroup({required: true});
// or should the input be {required: true}?
Oops, something went wrong.

0 comments on commit ccd1df2

Please sign in to comment.