Permalink
Browse files

Added conflictHandler test.

  • Loading branch information...
1 parent 4c7e90c commit f67f47440f9a1d27ee72746787fa4f6acacfcc1a William Collins committed Jan 21, 2013
Showing with 11 additions and 0 deletions.
  1. +11 −0 test/base.js
View
@@ -115,6 +115,17 @@ describe('base', function () {
);
});
+ it("should overwrite arguments when given the 'resolve' conflictHandler", function () {
+ parser = new ArgumentParser({conflictHandler: 'resolve'});
+
+ parser.addArgument(['--foo'], {help: 'old foo'});
+ parser.addArgument(['--foo'], {help: 'new foo'});
+
+ var help = parser._optionStringActions['--foo'].help;
+
+ assert.equal(help, 'new foo');
+ });
+
it("should parse negative arguments", function () {
parser = new ArgumentParser({debug: true});
parser.addArgument(['-f', '--foo']);

0 comments on commit f67f474

Please sign in to comment.