Skip to content

Commit

Permalink
Cover changed line. I hate you coverage.
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Wahl <matthiaswahl@m7w3.de>
  • Loading branch information
mfelsche committed May 9, 2022
1 parent 8b40854 commit ec79225
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/connectors/impls/metronome.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,35 @@ impl Source for MetronomeSource {
false
}
}

#[cfg(test)]
mod tests {

use crate::{
config::Reconnect,
connectors::ConnectorBuilder,
errors::{Error, Kind as ErrorKind, Result},
};
#[async_std::test]
async fn missing_config() -> Result<()> {
let builder = super::Builder::default();
let connector_config = super::ConnectorConfig {
connector_type: builder.connector_type(),
codec: None,
config: None,
preprocessors: None,
postprocessors: None,
reconnect: Reconnect::None,
metrics_interval_s: Some(5),
};
assert!(matches!(
builder
.build("snot", &connector_config)
.await
.err()
.unwrap(),
Error(ErrorKind::MissingConfiguration(_), _)
));
Ok(())
}
}

0 comments on commit ec79225

Please sign in to comment.