From a246678acce4a96f15ead03e6a609e92145866f6 Mon Sep 17 00:00:00 2001 From: Schneems Date: Mon, 29 Jan 2024 10:00:15 -0600 Subject: [PATCH] Add failing test and fix test spelling --- .../src/buildpack_output/mod.rs | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/libherokubuildpack/src/buildpack_output/mod.rs b/libherokubuildpack/src/buildpack_output/mod.rs index 16260a3d..f3c3895e 100644 --- a/libherokubuildpack/src/buildpack_output/mod.rs +++ b/libherokubuildpack/src/buildpack_output/mod.rs @@ -411,12 +411,40 @@ mod test { assert_contains!(actual, " hello world\n"); } + #[test] + fn warning_after_buildpack() { + let writer = Vec::new(); + let io = BuildpackOutput::new(writer) + .start("RCT") + .warning("It's too crowded here\nI'm tired") + .section("Guest thoughts") + .step("The jumping fountains are great") + .step("The music is nice here") + .end_section() + .finish(); + + let expected = formatdoc! {" + + # RCT + + ! It's too crowded here + ! I'm tired + + - Guest thoughts + - The jumping fountains are great + - The music is nice here + - Done (finished in < 0.1s) + "}; + + assert_eq!(expected, strip_control_codes(String::from_utf8_lossy(&io))); + } + #[test] fn warning_step_padding() { let writer = Vec::new(); let io = BuildpackOutput::new(writer) .start("RCT") - .section("Guest thoughs") + .section("Guest thoughts") .step("The scenery here is wonderful") .warning("It's too crowded here\nI'm tired") .step("The jumping fountains are great") @@ -428,7 +456,7 @@ mod test { # RCT - - Guest thoughs + - Guest thoughts - The scenery here is wonderful ! It's too crowded here