diff --git a/tests/_data/scan.png b/tests/_data/scan.png new file mode 100644 index 0000000..7a5475a Binary files /dev/null and b/tests/_data/scan.png differ diff --git a/tests/command/scan/_execute_test.sh b/tests/command/scan/_execute_test.sh new file mode 100644 index 0000000..599d09c --- /dev/null +++ b/tests/command/scan/_execute_test.sh @@ -0,0 +1,90 @@ +#!/usr/bin/env bash + +# ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +function set_up() +{ + export TEST_HOME="/tmp/bashunit_config_test_$$" + export HOME="${TEST_HOME}" + + mkdir -p "${TEST_HOME}/.config/pdfmt" + mkdir -p "${TEST_HOME}/bin" + + cat > "${TEST_HOME}/.config/pdfmt/scan.conf" < "${TEST_HOME}/bin/scanimage" < "${TEST_HOME}/bin/scanimage" <<'EOF' +#!/usr/bin/env bash +exit 1 +EOF + + chmod +x "${TEST_HOME}/bin/scanimage" + + _command_scan_execute \ + adf \ + "${output_file}" || exit_code=$? + + assert_same "1" "${exit_code}" +}