@@ -31,17 +31,17 @@ lab.experiment('api', function () {
3131 dbmigrate . silence ( true ) ;
3232
3333 /**
34- * We have set force-exit above, this should end up in db-migrate
35- * executing process.exit on the final callback.
36- * Process.exit has been overwritten and will finally call validate.
37- *
38- * The test validation takes place in validate()
39- */
34+ * We have set force-exit above, this should end up in db-migrate
35+ * executing process.exit on the final callback.
36+ * Process.exit has been overwritten and will finally call validate.
37+ *
38+ * The test validation takes place in validate()
39+ */
4040 dbmigrate . up ( ) ;
4141
4242 /**
43- * Final validation after process.exit should have been called.
44- */
43+ * Final validation after process.exit should have been called.
44+ */
4545 function validate ( ) {
4646 Code . expect ( called ) . to . be . true ( ) ;
4747 done ( ) ;
@@ -59,8 +59,8 @@ lab.experiment('api', function () {
5959 }
6060
6161 /**
62- * Create a migration with the programatic API and overwrite process.exit.
63- */
62+ * Create a migration with the programatic API and overwrite process.exit.
63+ */
6464 function overwriteExit ( ) {
6565 process . exit = function ( err ) {
6666 var ret = called ;
@@ -110,6 +110,26 @@ lab.experiment('api', function () {
110110 done ( ) ;
111111 } ) ;
112112
113+ lab . test ( 'should load commandline options from options parameter' , function (
114+ done
115+ ) {
116+ var options = {
117+ cmdOptions : {
118+ 'migrations-dir' : './test'
119+ }
120+ } ;
121+
122+ var api = stubApiInstance ( true , { } , options ) ;
123+ var actual = api . internals . argv [ 'migrations-dir' ] ;
124+ var expected = options . cmdOptions [ 'migrations-dir' ] ;
125+
126+ delete expected . getCurrent ;
127+ delete actual . getCurrent ;
128+
129+ Code . expect ( actual ) . to . equal ( expected ) ;
130+ done ( ) ;
131+ } ) ;
132+
113133 lab . test (
114134 'should handle all up parameter variations properly' ,
115135
0 commit comments