diff --git a/exercises/05_ticket_v2/09_error_trait/src/lib.rs b/exercises/05_ticket_v2/09_error_trait/src/lib.rs index 53dd114..ca89efc 100644 --- a/exercises/05_ticket_v2/09_error_trait/src/lib.rs +++ b/exercises/05_ticket_v2/09_error_trait/src/lib.rs @@ -95,5 +95,11 @@ mod tests { assert_eq!(ticket.description, "Description not provided"); } + #[test] + fn display_is_correctly_implemented() { + let ticket = Ticket::new("".into(), valid_description(), Status::ToDo); + assert_eq!(format!("{}", ticket.unwrap_err()), "Title cannot be empty"); + } + assert_impl_one!(TicketNewError: std::error::Error); }