Skip to content

Commit 532e20c

Browse files
committed
test: Add test case that accounts for wrong site name. Closes #36
1 parent 56f51ad commit 532e20c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/do-remove.bats

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,23 @@ load 'util/init.sh'
5656
assert [ ! -d "$BPM_PACKAGES_PATH/github.com/$pkg" ]
5757
}
5858

59+
@test "fails to remove package directory with wrong site name" {
60+
local site='github.com'
61+
local pkg='username/package'
62+
63+
test_util.setup_pkg "$pkg"; {
64+
touch 'bpm.toml'
65+
touch 'file.sh'
66+
}; test_util.finish_pkg
67+
test_util.fake_install "$pkg"
68+
69+
assert [ -d "$BPM_PACKAGES_PATH/github.com/$pkg" ]
70+
71+
run do-remove "gitlab.com/$pkg"
72+
73+
assert_failure
74+
}
75+
5976
@test "properly removes parent of package directory, if it is empty" {
6077
local site='github.com'
6178
local pkg='username/package'

0 commit comments

Comments
 (0)