()
| 278 | |
| 279 | #[test] |
| 280 | fn test_create_new_migration() { |
| 281 | let migration_name = "test_name"; |
| 282 | let migration_dir = "/tmp/sea_orm_cli_test_new_migration/"; |
| 283 | fs::create_dir_all(format!("{migration_dir}src")).unwrap(); |
| 284 | create_new_migration(migration_name, migration_dir).unwrap(); |
| 285 | let migration_filepath = Path::new(migration_dir) |
| 286 | .join("src") |
| 287 | .join(format!("{migration_name}.rs")); |
| 288 | assert!(migration_filepath.exists()); |
| 289 | let migration_content = fs::read_to_string(migration_filepath).unwrap(); |
| 290 | assert_eq!( |
| 291 | &migration_content, |
| 292 | include_str!("../../template/migration/src/m20220101_000001_create_table.rs") |
| 293 | ); |
| 294 | fs::remove_dir_all("/tmp/sea_orm_cli_test_new_migration/").unwrap(); |
| 295 | } |
| 296 | |
| 297 | #[test] |
| 298 | fn test_update_migrator() { |
nothing calls this directly
no test coverage detected