mirror of
https://github.com/SkyfallWasTaken/arcade-monitor.git
synced 2025-05-23 20:13:04 +00:00
Use pretty_assertions, fix deleted items notification test
This commit is contained in:
parent
2c511eead9
commit
9abdff79f5
4 changed files with 36 additions and 4 deletions
|
@ -73,6 +73,7 @@ pub fn format_deleted_item(item: &ShopItem) -> String {
|
|||
mod format_new_tests {
|
||||
use super::*;
|
||||
use indoc::indoc;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
#[test]
|
||||
fn item_formatted() {
|
||||
|
|
13
src/lib.rs
13
src/lib.rs
|
@ -103,8 +103,10 @@ fn diff_old_new_items(old_items: &ShopItems, new_items: &ShopItems) -> Vec<Strin
|
|||
#[cfg(test)]
|
||||
mod diff_old_new_items_tests {
|
||||
use super::*;
|
||||
use indoc::indoc;
|
||||
|
||||
use indoc::formatdoc;
|
||||
use items::ShopItem;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
#[test]
|
||||
fn deleted_items_notification() {
|
||||
|
@ -130,9 +132,12 @@ mod diff_old_new_items_tests {
|
|||
assert_eq!(
|
||||
result[0],
|
||||
formatdoc! {
|
||||
"*Item DELETED:* Item 2
|
||||
*Description:* Description 2
|
||||
*Price:* 200"
|
||||
"*Item DELETED:* {full_name}
|
||||
*Description:* {description}
|
||||
*Price:* {price}",
|
||||
full_name = item_2.full_name,
|
||||
description = item_2.description.as_ref().unwrap_or(&"_not set_".into()),
|
||||
price = item_2.price,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue