Commit 8321105 1 parent 0c336c4 commit 8321105 Copy full SHA for 8321105
File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,29 @@ fn list_migrations() {
263
263
) ;
264
264
}
265
265
266
+ #[ test]
267
+ fn list_migrations_missing_cargo_toml ( ) {
268
+ let tmp_dir = tempfile:: tempdir ( ) . unwrap ( ) ;
269
+
270
+ let migrations = migration_generator:: list_migrations ( tmp_dir. path ( ) ) ;
271
+
272
+ assert ! ( migrations. is_err( ) ) ;
273
+ }
274
+
275
+ #[ test]
276
+ fn list_migrations_missing_migrations_dir ( ) {
277
+ let cot_cli_dir = PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) ) ;
278
+ let example_dir = cot_cli_dir
279
+ . parent ( )
280
+ . unwrap ( )
281
+ . join ( "examples" )
282
+ . join ( "hello-world" ) ;
283
+
284
+ let migrations = migration_generator:: list_migrations ( & example_dir) . unwrap ( ) ;
285
+
286
+ assert ! ( migrations. is_empty( ) ) ;
287
+ }
288
+
266
289
fn test_generator ( ) -> MigrationGenerator {
267
290
MigrationGenerator :: new (
268
291
PathBuf :: from ( "Cargo.toml" ) ,
You can’t perform that action at this time.
0 commit comments