tdd-java-demo
tdd java demo with micro-commits
git clone https://9o.is/git/tdd-java-demo.git
commit be497a83cdac479b4de05c29ce0fda3d6475d45b parent b4b384ca07bf9e3c61de6730adc8ac7af1d4f00e Author: Jul <jul@9o.is> Date: Thu, 1 Apr 2021 01:40:05 +0800 reformat output method signature in RunnerTest Diffstat:
| M | src/test/java/takehome/RunnerTest.java | | | 5 | +++-- |
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/test/java/takehome/RunnerTest.java b/src/test/java/takehome/RunnerTest.java @@ -14,7 +14,7 @@ class RunnerTest { @Test public void example() { - assertThat(output("2\r1\r1\r2\r0"), contains( + assertThat(output("2", "1", "1", "2", "0"), contains( "How much soup? ", "How much bread? ", "How much milk? ", @@ -24,7 +24,8 @@ class RunnerTest { )); } - private List<String> output(String input) { + private List<String> output(String ...inputs) { + String input = String.join("\r", inputs); ByteArrayInputStream in = new ByteArrayInputStream(input.getBytes()); ByteArrayOutputStream out = new ByteArrayOutputStream(); new Runner(in, out).run();