From 917c9a3c87a74da6d171e8adc90aba2550278995 Mon Sep 17 00:00:00 2001 From: Philipp Korber Date: Fri, 16 Nov 2018 18:09:38 +0100 Subject: core(smtp/deps) applied remaining changes from deps to smtp crate --- smtp/Cargo.toml | 6 +++++- smtp/src/request.rs | 9 ++++----- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'smtp') diff --git a/smtp/Cargo.toml b/smtp/Cargo.toml index 536a92e..28b18fd 100644 --- a/smtp/Cargo.toml +++ b/smtp/Cargo.toml @@ -20,4 +20,8 @@ new-tokio-smtp = "0.8.1" [features] test-with-traceing = ["mail-internals/traceing"] -extended-api = [] \ No newline at end of file +extended-api = [] + + +[dev-dependencies] +mail-core = { path="../core", features=["test-utils"] } \ No newline at end of file diff --git a/smtp/src/request.rs b/smtp/src/request.rs index 5f68437..6a17aac 100644 --- a/smtp/src/request.rs +++ b/smtp/src/request.rs @@ -172,17 +172,16 @@ mod test { use mail::{ Mail, Resource, - file_buffer::FileBuffer + test_utils::CTX }; use headers::{ headers::{_From, _To, Sender}, - header_components::MediaType + header_components::{MediaType }, }; + fn mock_resource() -> Resource { - let mt = MediaType::parse("text/plain; charset=utf-8").unwrap(); - let fb = FileBuffer::new(mt, "abcd↓efg".to_owned().into()); - Resource::sourceless_from_buffer(fb) + Resource::plain_text("abcd↓efg", CTX.unwrap()) } #[test] -- cgit v1.2.3