-
Notifications
You must be signed in to change notification settings - Fork 14
/
corner_cases.feature
56 lines (50 loc) · 2.53 KB
/
corner_cases.feature
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
51
52
53
54
55
56
Feature: Corner Cases
Scenario: sdk not initialized in this shell
Given environment variable SDKMAN_DIR is not set
When a new Fish shell is launched
Then environment variable SDKMAN_DIR has the original value
Scenario: Custom installation path via env var
Given SDKMAN! is installed at /tmp/sdkman
And environment variable SDKMAN_DIR is set to "/tmp/sdkman"
When we run "sdk version" in Fish
Then the exit code is 0
And the output contains "SDKMAN!"
And environment variable SDKMAN_DIR has value "/tmp/sdkman"
And environment variable ANT_HOME has value "/tmp/sdkman/candidates/ant/current"
Scenario: Custom installation path via fish config
Given SDKMAN! is installed at /tmp/sdkman
And environment variable SDKMAN_DIR is set to "/something/wicked"
And fish config file config_sdk.fish exists with content
"""
set -g __sdkman_custom_dir /tmp/sdkman
"""
When we run "sdk version" in Fish
Then the exit code is 0
And the output contains "SDKMAN!"
And environment variable SDKMAN_DIR has value "/tmp/sdkman"
And environment variable ANT_HOME has value "/tmp/sdkman/candidates/ant/current"
Scenario Outline: Completions with custom installation path
Given SDKMAN! is installed at /tmp/sdkman
And environment variable SDKMAN_DIR is set to "/tmp/sdkman"
When the user enters "<cmd>" into the prompt
Then completion should propose "<completions>"
Examples:
| cmd | completions |
| install an | ant |
| uninstall an | ant |
| uninstall ant 1 | 1.10.1, 1.9.9 |
| list an | ant |
| use an | ant |
| use ant 1 | 1.10.1, 1.9.9 |
| default an | ant |
| default ant 1 | 1.10.1, 1.9.9 |
| home an | ant |
| home ant 1 | 1.10.1, 1.9.9 |
| current an | ant |
| upgrade an | ant |
@pending # cf. issue #10
Scenario: PATH should contain only valid paths
Given candidate kscript is installed
When candidate kscript is uninstalled
Then environment variable PATH cannot contain "sdkman/candidates/kscript/"
# TODO: add test that fails if `test` in conf.d/sdk.fish:80 errors (cf issue #28 et al.)