Skip to content

Commit

Permalink
Add schema name extract in the visitor
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel de Maeztu <[email protected]>
  • Loading branch information
merqurio committed Aug 25, 2024
1 parent 77a94c1 commit d2ae0bd
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 85 deletions.
16 changes: 8 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,20 +184,20 @@ mod tests {

let matches = cmd.try_get_matches_from(vec![
"oxigration",
"generate",
"migrate",
"-d",
"test_schemas/",
"tests/schemas/baseline/",
"-c",
"postgresql://test@localhost/test",
]);

assert!(matches.is_ok());
let matches = matches.unwrap();
assert_eq!(matches.subcommand_name(), Some("generate"));
assert_eq!(matches.subcommand_name(), Some("migrate"));
if let Some(sub_matches) = matches.subcommand_matches("generate") {
assert_eq!(
sub_matches.get_one::<String>("dir").unwrap(),
"test_schemas/"
"tests/schemas/baseline/"
);
assert_eq!(
sub_matches.get_one::<String>("connection").unwrap(),
Expand All @@ -212,20 +212,20 @@ mod tests {

let matches = cmd.try_get_matches_from(vec![
"oxigration",
"migrate",
"generate",
"-d",
"test_schemas/",
"tests/schemas/generated/",
"-c",
"postgresql://test@localhost/test",
]);

assert!(matches.is_ok());
let matches = matches.unwrap();
assert_eq!(matches.subcommand_name(), Some("migrate"));
assert_eq!(matches.subcommand_name(), Some("generate"));
if let Some(sub_matches) = matches.subcommand_matches("migrate") {
assert_eq!(
sub_matches.get_one::<String>("dir").unwrap(),
"test_schemas/"
"tests/schemas/generated/"
);
assert_eq!(
sub_matches.get_one::<String>("connection").unwrap(),
Expand Down
Loading

0 comments on commit d2ae0bd

Please sign in to comment.