@@ -10,12 +10,14 @@ var path = require('path')
1010describe ( 'yargs-parser' , function ( ) {
1111 it ( 'should parse a "short boolean"' , function ( ) {
1212 var parse = parser ( [ '-b' ] )
13+ parse . should . not . have . property ( '--' )
1314 parse . should . have . property ( 'b' ) . to . be . ok . and . be . a ( 'boolean' )
1415 parse . should . have . property ( '_' ) . with . length ( 0 )
1516 } )
1617
1718 it ( 'should parse a "long boolean"' , function ( ) {
1819 var parse = parser ( '--bool' )
20+ parse . should . not . have . property ( '--' )
1921 parse . should . have . property ( 'bool' , true )
2022 parse . should . have . property ( '_' ) . with . length ( 0 )
2123 } )
@@ -113,6 +115,16 @@ describe('yargs-parser', function () {
113115 parse . should . have . property ( '_' ) . and . deep . equal ( [ 'bare' , '--not-a-flag' , '-' , '-h' , '-multi' , '--' , 'eek' ] )
114116 } )
115117
118+ it ( 'should not populate "--" if parsing was not stopped' , function ( ) {
119+ var parse = parser ( [ '-b' ] )
120+ parse . should . not . have . property ( '--' )
121+ } )
122+
123+ it ( 'should populate "--" if parsing is stopped' , function ( ) {
124+ var parse = parser ( [ '-b' , '--' , 'foo bar' ] )
125+ parse . should . have . property ( '--' )
126+ } )
127+
116128 it ( 'should parse numbers appropriately' , function ( ) {
117129 var argv = parser ( [
118130 '-x' , '1234' ,
0 commit comments