Skip to content

Commit

Permalink
[EpicsDAO#21] fix wrong refactoring breaking tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasCir committed Oct 11, 2022
1 parent 7dd52f7 commit 97eeb3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/gen/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use zapp::gen::handle_gen;
#[test]
fn gen_one_user_model() {
let tmp_dir = TempDir::new("zapp-gen-integration-tests").unwrap();
let resource_dir = Path::new("tests/g/resources/gen_one_user_model");
let resource_dir = Path::new("tests/gen/resources/gen_one_user_model");

let test_dt = NaiveDate::from_ymd(2022, 7, 16).and_hms(23, 39, 33);

Expand All @@ -24,8 +24,8 @@ fn gen_one_user_model() {
assert_file_equality(resource_dir, tmp_dir.path(), "migration/src/lib.rs");

assert_file_equality(resource_dir, tmp_dir.path(), "src/graphql/query/user.rs");
assert_file_equality(resource_dir, tmp_dir.path(), "src/graphql/query/gen");
assert_file_equality(resource_dir, tmp_dir.path(), "src/graphql/query/mod.rs");

assert_file_equality(resource_dir, tmp_dir.path(), "src/graphql/mutation/user.rs");
assert_file_equality(resource_dir, tmp_dir.path(), "src/graphql/mutation/gen");
assert_file_equality(resource_dir, tmp_dir.path(), "src/graphql/mutation/mod.rs");
}
2 changes: 2 additions & 0 deletions tests/gen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use std::{fs::File, io::Read, path::Path};
mod integration_test;

fn assert_file_equality(resource_dir: &Path, tmp_dir: &Path, path: &str) {
dbg!(&resource_dir);
dbg!(&path);
let mut resource_file = File::open(resource_dir.join(path)).unwrap();

let mut tmp_file = File::open(tmp_dir.join(path)).unwrap();
Expand Down

0 comments on commit 97eeb3c

Please sign in to comment.