diff options
| author | Zeyla Hellyer <[email protected]> | 2017-11-16 10:28:21 -0800 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-11-16 10:28:40 -0800 |
| commit | 7a5aa3c57951ee5c7267fabf38f2729b06629b34 (patch) | |
| tree | a6ee66602e4eee134b9c03ded02d96d433427d61 /tests | |
| parent | Fix doc-tests (diff) | |
| download | serenity-7a5aa3c57951ee5c7267fabf38f2729b06629b34.tar.xz serenity-7a5aa3c57951ee5c7267fabf38f2729b06629b34.zip | |
impl From<&Path> for http::AttachmentType
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_http.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_http.rs b/tests/test_http.rs new file mode 100644 index 0000000..1389ef6 --- /dev/null +++ b/tests/test_http.rs @@ -0,0 +1,18 @@ +#![cfg(feature = "http")] + +extern crate serenity; + +use serenity::http::AttachmentType; +use std::path::Path; + +#[test] +fn test_attachment_type() { + assert!(match AttachmentType::from(Path::new("./dogs/corgis/kona.png")) { + AttachmentType::Path(_) => true, + _ => false, + }); + assert!(match AttachmentType::from("./cats/copycat.png") { + AttachmentType::Path(_) => true, + _ => false, + }); +} |