test: move small adapter tests to tests/
event-publisher, export, rss, media-server, object-storage, nats(config).
Kept inline (private fn, no public path): nats src/subject.rs
tests::{review_logged_subject,review_updated_subject,movie_discovered_subject,
consumer_subject_filter_appends_wildcard} - event_to_subject/consumer_subject_filter private.
object-storage build_local_store tests rewritten via StorageConfig::from_config.
This commit is contained in:
@@ -35,7 +35,3 @@ impl NatsConfig {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "tests/config.rs"]
|
||||
mod tests;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use super::*;
|
||||
use nats::{NatsConfig, NatsMode};
|
||||
|
||||
fn section(url: Option<&str>, mode: &str) -> ::config::NatsConfig {
|
||||
::config::NatsConfig {
|
||||
fn section(url: Option<&str>, mode: &str) -> config::NatsConfig {
|
||||
config::NatsConfig {
|
||||
url: url.map(str::to_owned),
|
||||
mode: mode.into(),
|
||||
..Default::default()
|
||||
@@ -10,12 +10,12 @@ fn section(url: Option<&str>, mode: &str) -> ::config::NatsConfig {
|
||||
|
||||
#[test]
|
||||
fn errors_without_nats_url() {
|
||||
assert!(NatsConfig::from_config(&::config::NatsConfig::default()).is_err());
|
||||
assert!(NatsConfig::from_config(&config::NatsConfig::default()).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn defaults_with_only_url() {
|
||||
let cfg = NatsConfig::from_config(&::config::NatsConfig {
|
||||
let cfg = NatsConfig::from_config(&config::NatsConfig {
|
||||
url: Some("nats://localhost:4222".into()),
|
||||
..Default::default()
|
||||
})
|
||||
Reference in New Issue
Block a user