Skip to content

Commit 8210a6d

Browse files
committed
Add test for making sure that example config is valid
1 parent 96d8499 commit 8210a6d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/config.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ where
156156
#[cfg(test)]
157157
mod tests {
158158
use crate::config::{RepositoryConfig, default_timeout, deserialize_config};
159+
use std::path::Path;
159160
use std::{collections::BTreeMap, time::Duration};
160161

161162
#[test]
@@ -278,6 +279,15 @@ approved = ["foo"]
278279
load_config(content);
279280
}
280281

282+
#[test]
283+
fn load_example_config() {
284+
let path = Path::new(env!("CARGO_MANIFEST_DIR")).join("rust-bors.example.toml");
285+
let config = std::fs::read_to_string(path)
286+
.expect("Cannot load example bors config from repository root");
287+
deserialize_config(&config)
288+
.expect("Cannot deserialize example bors config from `rust-bors.example.toml`");
289+
}
290+
281291
fn load_config(config: &str) -> RepositoryConfig {
282292
deserialize_config(config).expect("Cannot deserialize repository config")
283293
}

0 commit comments

Comments
 (0)