From cf06b1c605a04fdd286b776dbecc22fe9db8b725 Mon Sep 17 00:00:00 2001 From: Harpreet Singh Date: Wed, 2 Feb 2022 22:58:54 +0530 Subject: [PATCH] Exercise 01 --- ex01/hello_world.sh | 7 +++++++ ex01/hello_world_test.sh | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 ex01/hello_world.sh diff --git a/ex01/hello_world.sh b/ex01/hello_world.sh new file mode 100644 index 0000000..38e1002 --- /dev/null +++ b/ex01/hello_world.sh @@ -0,0 +1,7 @@ +function hello_world() +{ + val='Hello, World!' +} + +hello_world +echo $val diff --git a/ex01/hello_world_test.sh b/ex01/hello_world_test.sh index bc6946b..c2d05f4 100644 --- a/ex01/hello_world_test.sh +++ b/ex01/hello_world_test.sh @@ -20,3 +20,10 @@ [ "$status" -eq 0 ] [ "$output" = "Hello, Bob!" ] } + +@test 'Check called it should print Hello, World!' { + run bash hello_world.sh + + [ "$status" -eq 0 ] + [ "$output" = "Hello, World!" ] +}