parse_modified.js 569 B

123456789101112131415161718192021
  1. var should = require('chai').should(),
  2. yargs = require('../');
  3. describe('parse', function () {
  4. describe('boolean modifier function', function () {
  5. it('should prevent yargs from sucking in the next option as the value of the first option', function () {
  6. // Arrange & Act
  7. var result = yargs().boolean('b').parse([ '-b', '123' ]);
  8. // Assert
  9. result.should.have.property('b').that.is.a('boolean').and.is.true;
  10. result.should.have.property('_').and.deep.equal([123]);
  11. });
  12. });
  13. });