diff --git a/tests/07-remove.sh b/tests/07-remove.sh new file mode 100644 index 000000000..9ee185b9f --- /dev/null +++ b/tests/07-remove.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +test_description='Test the remove command' + +WHEREAMI=$(dirname "$(realpath "$0")") +. $WHEREAMI/setup.sh + +test_expect_success 'cabin remove tbb mydep toml11' ' + test_when_finished "rm -rf remove_test" && + "$CABIN_BIN" new remove_test && + cd remove_test && + echo "[dependencies]" >> cabin.toml && + echo "tbb = {}" >> cabin.toml && + echo "toml11 = {}" >> cabin.toml && + ( + "$CABIN_BIN" remove tbb mydep toml11 >actual 2>&1 && + ! grep -q "tbb" cabin.toml && + ! grep -q "toml11" cabin.toml + ) && + cat >expected <<-EOF && +Warning: Dependency \`mydep\` not found in $WHEREAMI/trash directory.07-remove.sh/remove_test/cabin.toml + Removed tbb, toml11 from $WHEREAMI/trash directory.07-remove.sh/remove_test/cabin.toml +EOF + test_cmp expected actual +' +test_done