Skip to content

Commit

Permalink
Refactor to introduce a project local path dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
la10736 committed Jan 22, 2023
1 parent 478baa1 commit 9ece1be
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions rstest_test/src/prj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,12 @@ impl Project {
self.save_cargo_toml(&doc);
}

pub fn add_path_dependency(&self, name: &str, path: &str) {
self.add_dependency(name, format!(r#"{{path="{}"}}"#, path).as_str());
}

pub fn add_local_dependency(&self, name: &str) {
self.add_dependency(
name,
format!(r#"{{path="{}"}}"#, self.exec_dir_str()).as_str(),
);
self.add_path_dependency(name, &self.exec_dir_str());
}

pub fn exec_dir_str(&self) -> String {
Expand Down

0 comments on commit 9ece1be

Please sign in to comment.