From 1e7c85b680104b83e67c4b69f0a49a37f349cdbd Mon Sep 17 00:00:00 2001 From: Osamu Aoki Date: Mon, 14 Oct 2019 21:52:02 +0900 Subject: [PATCH] Use correct path for shunit2 Since: _Note: the script as it stands expects that you are running it from the "examples" directory._ shunit2 is located in ../shunit2 Signed-off-by: Osamu Aoki --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 335a6ca..ccdf05d 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ testEquality() { } # Load shUnit2. -. ./shunit2 +. ../shunit2 ``` Running the unit test should give results similar to the following. @@ -168,7 +168,7 @@ testPartyLikeItIs1999() { } # Load shUnit2. -. ./shunit2 +. ../shunit2 ``` So, what did you get? I guess it told you that this isn't 1999. Bummer, eh? @@ -184,6 +184,15 @@ ton more examples, take a look at the tests provided with [log4sh][log4sh] or shUnit2 was after all written to meet the unit testing need that [log4sh][log4sh] had. +If you are using distribution packaged shUnit2 which is accessible from +`/usr/bin/shunit2` such as Debian, you can load shUnit2 without specifying its +path. So the last 2 lines in the above can be replaced by: + +```sh +# Load shUnit2. +. shunit2 +``` + --- ## Function Reference @@ -460,7 +469,7 @@ testLineNo() { } # Load shUnit2. -. ./shunit2 +. ../shunit2 ``` Notes: @@ -540,7 +549,7 @@ oneTimeSetUp() { } # Load and run shUnit2. -. ./shunit2 +. ../shunit2 ``` Running the above test under the __bash__ shell will result in the following