@@ -31,17 +31,17 @@ lab.experiment('api', function () {
31
31
dbmigrate . silence ( true ) ;
32
32
33
33
/**
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
+ */
40
40
dbmigrate . up ( ) ;
41
41
42
42
/**
43
- * Final validation after process.exit should have been called.
44
- */
43
+ * Final validation after process.exit should have been called.
44
+ */
45
45
function validate ( ) {
46
46
Code . expect ( called ) . to . be . true ( ) ;
47
47
done ( ) ;
@@ -59,8 +59,8 @@ lab.experiment('api', function () {
59
59
}
60
60
61
61
/**
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
+ */
64
64
function overwriteExit ( ) {
65
65
process . exit = function ( err ) {
66
66
var ret = called ;
@@ -110,6 +110,26 @@ lab.experiment('api', function () {
110
110
done ( ) ;
111
111
} ) ;
112
112
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
+
113
133
lab . test (
114
134
'should handle all up parameter variations properly' ,
115
135
0 commit comments