Skip to content

Commit 6c79f54

Browse files
committed
add an API in ConfigBuilder to point to config file for toml parsing
1 parent a12969e commit 6c79f54

File tree

1 file changed

+8
-0
lines changed
  • src/bootstrap/src/utils/tests

1 file changed

+8
-0
lines changed

src/bootstrap/src/utils/tests/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ impl ConfigBuilder {
9898
self
9999
}
100100

101+
pub fn config_toml(mut self, config_toml: &str) -> Self {
102+
let toml_path = self.directory.join("bootstrap.toml");
103+
std::fs::write(&toml_path, config_toml).unwrap();
104+
self.args.push("--config".to_string());
105+
self.args.push(toml_path.display().to_string());
106+
self
107+
}
108+
101109
pub fn create_config(mut self) -> Config {
102110
// Run in dry-check, otherwise the test would be too slow
103111
self.args.push("--dry-run".to_string());

0 commit comments

Comments
 (0)