Skip to content

Commit

Permalink
test: add integration test for remove command
Browse files Browse the repository at this point in the history
  • Loading branch information
SunPodder committed Jan 29, 2025
1 parent d2097b5 commit 468bb17
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/07-remove.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 468bb17

Please sign in to comment.