57d6fd00f0af2f80fe756d4deda975d509d062a9
- Author
- Michael Aquilina <michaelaquilina@gmail.com>
- Committer
- Michael Aquilina <michaelaquilina@gmail.com>
- Date
Diff
1diff --git a/tests/test_rmvenv.zunit b/tests/test_rmvenv.zunit
2new file mode 100644
3index 0000000000000000000000000000000000000000..6a15d41843e633d98f87ea247435c27e7c0add94
4--- /dev/null
5+++ b/tests/test_rmvenv.zunit
6@@ -0,0 +1,31 @@
7+#!/usr/bin/env zunit
8+
9+@setup {
10+ load "../autoswitch_virtualenv.plugin.zsh"
11+ target="$(mktemp -d)"
12+ assert "$target" is_dir
13+}
14+
15+@teardown {
16+ rm -rf "$teardown"
17+}
18+
19+@test 'rmvenv with no .venv' {
20+ cd "$target"
21+
22+ run rmvenv
23+
24+ assert "$output" same_as "No .venv file in the current directory!"
25+ assert $state equals 0
26+}
27+
28+@test 'rmvenv with existing .venv' {
29+ touch "$target/.venv"
30+ assert "$target/.venv" is_file
31+
32+ cd "$target"
33+ run rmvenv
34+
35+ assert "$output" is_empty
36+ assert $state equals 0
37+}