@@ -115,16 +115,6 @@ describe('yargs-parser', function () {
115115 parse . should . have . property ( '_' ) . and . deep . equal ( [ 'bare' , '--not-a-flag' , '-' , '-h' , '-multi' , '--' , 'eek' ] )
116116 } )
117117
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-
128118 it ( 'should parse numbers appropriately' , function ( ) {
129119 var argv = parser ( [
130120 '-x' , '1234' ,
@@ -2222,25 +2212,27 @@ describe('yargs-parser', function () {
22222212 } )
22232213
22242214 describe ( 'populate--' , function ( ) {
2225- it ( 'should populate "_" if "populate-- false ' , function ( ) {
2215+ it ( 'should populate "_" by default ' , function ( ) {
22262216 var result = parser ( [
22272217 'bare' ,
22282218 '--' , '-h' , 'eek' , '--'
2229- ] , {
2230- configuration : { 'populate--' : false }
2231- } )
2219+ ] )
22322220 result . should . have . property ( '_' ) . and . deep . equal ( [ 'bare' , '-h' , 'eek' , '--' ] )
22332221 result . should . not . have . property ( '--' )
22342222 } )
22352223
2236- it ( 'should populate the "--" array by default ' , function ( ) {
2224+ it ( 'should populate the "--" if populate-- is "true" ' , function ( ) {
22372225 var result = parser ( [
22382226 '--name=meowmers' , 'bare' , '-cats' , 'woo' , 'moxy' ,
22392227 '-h' , 'awesome' , '--multi=quux' ,
22402228 '--key' , 'value' ,
22412229 '-b' , '--bool' , '--no-meep' , '--multi=baz' ,
22422230 '--' , '--not-a-flag' , '-' , '-h' , '-multi' , '--' , 'eek'
2243- ] )
2231+ ] , {
2232+ configuration : {
2233+ 'populate--' : true
2234+ }
2235+ } )
22442236 result . should . have . property ( 'c' , true )
22452237 result . should . have . property ( 'a' , true )
22462238 result . should . have . property ( 't' , true )
0 commit comments