diff --git a/src/body.rs b/src/body.rs index 43c6c833..d02e508c 100644 --- a/src/body.rs +++ b/src/body.rs @@ -24,45 +24,45 @@ pub fn parse_body(root: &Element) -> Result { mod tests { use minidom::Element; use error::Error; - use chatstates; + use body; #[test] fn test_simple() { - let elem: Element = "".parse().unwrap(); - chatstates::parse_chatstate(&elem).unwrap(); + let elem: Element = "".parse().unwrap(); + body::parse_body(&elem).unwrap(); } #[test] fn test_invalid() { - let elem: Element = "".parse().unwrap(); - let error = chatstates::parse_chatstate(&elem).unwrap_err(); + let elem: Element = "".parse().unwrap(); + let error = body::parse_body(&elem).unwrap_err(); let message = match error { Error::ParseError(string) => string, _ => panic!(), }; - assert_eq!(message, "Unknown chatstate element."); + assert_eq!(message, "This is not a body element."); } #[test] fn test_invalid_child() { - let elem: Element = "".parse().unwrap(); - let error = chatstates::parse_chatstate(&elem).unwrap_err(); + let elem: Element = "".parse().unwrap(); + let error = body::parse_body(&elem).unwrap_err(); let message = match error { Error::ParseError(string) => string, _ => panic!(), }; - assert_eq!(message, "Unknown child in chatstate element."); + assert_eq!(message, "Unknown child in body element."); } #[test] #[ignore] fn test_invalid_attribute() { - let elem: Element = "".parse().unwrap(); - let error = chatstates::parse_chatstate(&elem).unwrap_err(); + let elem: Element = "".parse().unwrap(); + let error = body::parse_body(&elem).unwrap_err(); let message = match error { Error::ParseError(string) => string, _ => panic!(), }; - assert_eq!(message, "Unknown attribute in chatstate element."); + assert_eq!(message, "Unknown attribute in body element."); } } diff --git a/src/chatstates.rs b/src/chatstates.rs index 77db1413..1651e3a5 100644 --- a/src/chatstates.rs +++ b/src/chatstates.rs @@ -52,7 +52,7 @@ mod tests { Error::ParseError(string) => string, _ => panic!(), }; - assert_eq!(message, "Unknown chatstate element."); + assert_eq!(message, "This is not a chatstate element."); } #[test]