--- /dev/null
+#!/bin/bash
+
+errlog()
+{
+ local lastexit=$?
+ local msg="$1"
+
+ echo "❌ ERROR: $msg"
+ return $lastexit
+}
+
+main()
+{
+ command -v rsync > /dev/null \
+ || errlog "command rsync not found" \
+ || return $?
+}
+
+[ "$TEST_MODE" == "ON" ] && return 0
+main "$@"
\ No newline at end of file
--- /dev/null
+#!/usr/bin/bats
+
+setup() {
+ bats_load_library 'bats-support'
+ bats_load_library 'bats-assert'
+ export TEST_MODE="ON"
+ source src/albentohandy
+}
+
+teardown() {
+ unset TEST_MODE
+}
+
+@test "failed: rsync not found" {
+ command() {
+ [ "$2" == "rsync" ] && return 1
+ }
+
+ run main
+
+ assert_failure
+ assert_line --index 0 "❌ ERROR: command rsync not found"
+}
\ No newline at end of file