1
Fork 0

Add a test for all options.

This commit is contained in:
Bauke 2022-04-02 18:42:30 +02:00
parent b3c08e565a
commit c1a5b2d7dc
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 18 additions and 0 deletions

View File

@ -39,3 +39,13 @@ fn test_generator() {
insta::assert_debug_snapshot!(format!("generate-{name}"), urls);
}
}
#[test]
fn test_all_options() {
let generator = Generator::default()
.set_base_url("cdn.libravatar.org")
.set_image_size(128);
let urls = [BAUKE_EMAIL, HOLLLO_EMAIL].map(|email| generator.generate(email));
insta::assert_debug_snapshot!("generate-options", urls);
}

View File

@ -0,0 +1,8 @@
---
source: tests/lib.rs
expression: urls
---
[
"https://cdn.libravatar.org/avatar/ecd836ee843ff0ab75d4720bd40c2baf?s=128",
"https://cdn.libravatar.org/avatar/ebff9105dce4954b1bdb57fdab079ff3?s=128",
]