diff options
author | HampusM <hampus@hampusmat.com> | 2023-03-26 18:50:31 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-03-26 18:50:31 +0200 |
commit | 86f41e49f87764f9afd4be1d0d008a320dcfc331 (patch) | |
tree | 3e7cf94bcecd42ccf2f1e8eb9928a377d4fdb1bd /src/command.rs | |
parent | c8e5944d697b33738c7ba01694dde5e360470043 (diff) |
feat: add deserializing API interface definitions
Diffstat (limited to 'src/command.rs')
-rw-r--r-- | src/command.rs | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/src/command.rs b/src/command.rs index 5d3c935..fd449aa 100644 --- a/src/command.rs +++ b/src/command.rs @@ -310,43 +310,10 @@ mod tests { use pretty_assertions::assert_str_eq; use quick_xml::events::Event; - use ridicule::mock; use ridicule::predicate::{always, eq, function}; use super::*; - - mock! { - MockDeserializer {} - - impl Deserializer for MockDeserializer { - fn de_tag<De: Deserialize>( - &mut self, - tag_name: &str, - ignore_end: IgnoreEnd, - ) -> Result<De, DeserializerError>; - - fn de_tag_with<Output, Err, DeserializeFn>( - &mut self, - tag_name: &str, - ignore_end: IgnoreEnd, - deserialize: DeserializeFn, - ) -> Result<Output, DeserializerError> - where - Err: std::error::Error + Send + Sync + 'static, - DeserializeFn: FnOnce(&BytesStart, &mut MockDeserializer) -> Result<Output, Err>; - - fn de_tag_list<De: Deserialize>( - &mut self, - tag_name: &str - ) -> Result<Vec<De>, DeserializerError>; - - fn de_text(&mut self) -> Result<String, DeserializerError>; - - fn skip_to_tag_start(&mut self, tag_name: &str) -> Result<(), DeserializerError>; - - fn skip_to_tag_end(&mut self, tag_name: &str) -> Result<(), DeserializerError>; - } - } + use crate::deserialization::MockDeserializer; #[test] fn deserialize_prototype_works_with_ptype() |