File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ pub const CONFIG_FILE_PATH: &str = "rust-bors.toml";
1111/// Configuration of a repository loaded from a `rust-bors.toml`
1212/// file located in the root of the repository file tree.
1313#[ derive( serde:: Deserialize , Debug ) ]
14+ #[ serde( deny_unknown_fields) ]
1415pub struct RepositoryConfig {
1516 /// Maximum duration (in seconds) to wait for CI checks to complete before timing out.
1617 /// Defaults to 3600 seconds (1 hour).
@@ -268,6 +269,13 @@ try = ["foo"]
268269 "# ) ;
269270 }
270271
272+ #[ test]
273+ #[ should_panic( expected = "unknown field `labels-blocking-approval`" ) ]
274+ fn deserialize_unknown_key_fail ( ) {
275+ let content = r#"labels-blocking-approval = ["foo", "bar"]"# ;
276+ load_config ( content) ;
277+ }
278+
271279 fn load_config ( config : & str ) -> RepositoryConfig {
272280 toml:: from_str ( config) . unwrap ( )
273281 }
You can’t perform that action at this time.
0 commit comments