summaryrefslogtreecommitdiff
path: root/.config/fisher/github.com/matchai/spacefish/tests/__sf_section_venv.test.fish
blob: f60d23e1fab30057a94c8ddb127a2dee8852bad3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
source $DIRNAME/spacefish_test_setup.fish

function setup
	spacefish_test_setup
end

function teardown
	if test "$VIRTUAL_ENV"
		set -e VIRTUAL_ENV
	end
end

test "Prints section when \$VIRTUAL_ENV is defined"
	(
		set VIRTUAL_ENV "/Users/JaneDoe/.venv/coolenviron"

		set_color --bold
		echo -n $SPACEFISH_PROMPT_DEFAULT_PREFIX
		set_color normal
		set_color --bold blue
		echo -n "·coolenviron"
		set_color normal
		set_color --bold
		echo -n $SPACEFISH_PROMPT_DEFAULT_SUFFIX
		set_color normal
	) = (__sf_section_venv)
end

test "Prints section when \$VIRTUAL_ENV is defined with venv as the directory name"
	(
		set VIRTUAL_ENV "/Users/JaneDoe/.venv/coolenviron/virtualenv"

		set_color --bold
		echo -n $SPACEFISH_PROMPT_DEFAULT_PREFIX
		set_color normal
		set_color --bold blue
		echo -n "·coolenviron"
		set_color normal
		set_color --bold
		echo -n $SPACEFISH_PROMPT_DEFAULT_SUFFIX
		set_color normal
	) = (__sf_section_venv)
end

test "doesn't display the section when SPACEFISH_VENV_SHOW is set to \"false\""
	(
		set VIRTUAL_ENV "/Users/JaneDoe/.venv/coolenviron"
		set SPACEFISH_VENV_SHOW false
	) = (__sf_section_venv)
end