From a85e7d15c57c11d8286656531c7394681fb855d9 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 17 Feb 2021 08:49:38 +0200 Subject: refactor: move echo and muck examples under new examples/ directory --- echo.sh | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 echo.sh (limited to 'echo.sh') diff --git a/echo.sh b/echo.sh deleted file mode 100644 index 0564d42..0000000 --- a/echo.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -_run() -{ - if "$@" < /dev/null > stdout 2> stderr - then - ctx_set exit 0 - else - ctx_set exit "$?" - fi - ctx_set stdout "$(cat stdout)" - ctx_set stderr "$(cat stderr)" -} - -run_echo_without_args() -{ - _run echo -} - -run_echo_with_args() -{ - args="$(cap_get args)" - _run echo "$args" -} - -exit_code_is() -{ - actual_exit="$(ctx_get exit)" - wanted_exit="$(cap_get exit_code)" - assert_eq "$actual_exit" "$wanted_exit" -} - -stdout_is_a_newline() -{ - stdout="$(ctx_get stdout)" - assert_eq "$stdout" "$(printf '\n')" -} - -stdout_is_text() -{ - stdout="$(ctx_get stdout)" - text="$(cap_get text)" - assert_contains "$stdout" "$text" -} - -stderr_is_empty() -{ - stderr="$(ctx_get stderr)" - assert_eq "$stderr" "" -} -- cgit v1.2.1