From 9363426857c1ca3db1078dc5ae04f68488eee898 Mon Sep 17 00:00:00 2001
From: Raphael Reitzig <4246780+reitzig@users.noreply.github.com>
Date: Wed, 3 Apr 2024 21:51:03 +0200
Subject: [PATCH] fix: Tests for completions with custom install path
---
.gitignore | 2 -
.idea/.gitignore | 3 ++
..._features_in_features__sdkman_for_fish.xml | 51 -------------------
.../{Build_Test_Image.xml => Run_Tests.xml} | 9 ++--
test/features/corner_cases.feature | 23 +++++++++
5 files changed, 29 insertions(+), 59 deletions(-)
create mode 100644 .idea/.gitignore
delete mode 100644 .idea/runConfigurations/All_features_in_features__sdkman_for_fish.xml
rename .idea/runConfigurations/{Build_Test_Image.xml => Run_Tests.xml} (50%)
diff --git a/.gitignore b/.gitignore
index 98c52b8..e69de29 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +0,0 @@
-test/*_fish
-test/*_bash
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..060a6f2
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,3 @@
+*
+!.gitignore
+!runConfigurations
diff --git a/.idea/runConfigurations/All_features_in_features__sdkman_for_fish.xml b/.idea/runConfigurations/All_features_in_features__sdkman_for_fish.xml
deleted file mode 100644
index d85c24c..0000000
--- a/.idea/runConfigurations/All_features_in_features__sdkman_for_fish.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations/Build_Test_Image.xml b/.idea/runConfigurations/Run_Tests.xml
similarity index 50%
rename from .idea/runConfigurations/Build_Test_Image.xml
rename to .idea/runConfigurations/Run_Tests.xml
index a9c5ac3..091ad81 100644
--- a/.idea/runConfigurations/Build_Test_Image.xml
+++ b/.idea/runConfigurations/Run_Tests.xml
@@ -1,14 +1,11 @@
-
+
-
-
-
+
+
-
-
diff --git a/test/features/corner_cases.feature b/test/features/corner_cases.feature
index a41338c..205c638 100644
--- a/test/features/corner_cases.feature
+++ b/test/features/corner_cases.feature
@@ -23,6 +23,29 @@ Feature: Corner Cases
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 fish config file config_sdk.fish exists with content
+ """
+ set -g __sdkman_custom_dir /tmp/sdkman
+ """
+ When the user enters "" into the prompt
+ Then completion should propose ""
+ 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