-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add integration test for remove command
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |