Skip to content

Commit

Permalink
Add failing test and fix test spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Jan 29, 2024
1 parent 149eea5 commit a246678
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions libherokubuildpack/src/buildpack_output/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -428,7 +456,7 @@ mod test {
# RCT
- Guest thoughs
- Guest thoughts
- The scenery here is wonderful
! It's too crowded here
Expand Down

0 comments on commit a246678

Please sign in to comment.