fix(test): Use kscript as test candidate

instead of crash, which doesn't exist anymore
This commit is contained in:
Raphael Reitzig 2023-06-25 18:53:17 +02:00
parent 1b2824d37f
commit e9f967501c
4 changed files with 57 additions and 57 deletions

View file

@ -7,8 +7,8 @@ Feature: Support autoenv setting
And candidate ant is installed at version 1.9.7 And candidate ant is installed at version 1.9.7
And candidate ant is installed at version 1.9.9 And candidate ant is installed at version 1.9.9
And candidate ant is installed at version 1.10.1 And candidate ant is installed at version 1.10.1
And candidate crash is installed at version 1.2.11 And candidate kscript is installed at version 1.5.0
And candidate crash is installed at version 1.3.0 And candidate kscript is installed at version 1.6.0
Scenario: No action if autoenv turned off Scenario: No action if autoenv turned off
Given SDKMAN! config sets sdkman_auto_env to false Given SDKMAN! config sets sdkman_auto_env to false
@ -59,7 +59,7 @@ Feature: Support autoenv setting
And file /tmp/autoenv-test-1/.sdkmanrc exists with content And file /tmp/autoenv-test-1/.sdkmanrc exists with content
""" """
ant=1.9.9 ant=1.9.9
crash=1.2.11 kscript=1.5.0
""" """
And file /tmp/autoenv-test-2/.sdkmanrc exists with content And file /tmp/autoenv-test-2/.sdkmanrc exists with content
""" """
@ -67,18 +67,18 @@ Feature: Support autoenv setting
""" """
When we run fish script When we run fish script
""" """
echo (basename (realpath $ANT_HOME)),(basename (realpath $CRASH_HOME)) > /tmp/autoenv-test.log echo (basename (realpath $ANT_HOME)),(basename (realpath $KSCRIPT_HOME)) > /tmp/autoenv-test.log
cd /tmp/autoenv-test-1 cd /tmp/autoenv-test-1
echo (basename (realpath $ANT_HOME)),(basename (realpath $CRASH_HOME)) >> /tmp/autoenv-test.log echo (basename (realpath $ANT_HOME)),(basename (realpath $KSCRIPT_HOME)) >> /tmp/autoenv-test.log
cd ../autoenv-test-2 cd ../autoenv-test-2
echo (basename (realpath $ANT_HOME)),(basename (realpath $CRASH_HOME)) >> /tmp/autoenv-test.log echo (basename (realpath $ANT_HOME)),(basename (realpath $KSCRIPT_HOME)) >> /tmp/autoenv-test.log
cd .. cd ..
echo (basename (realpath $ANT_HOME)),(basename (realpath $CRASH_HOME)) >> /tmp/autoenv-test.log echo (basename (realpath $ANT_HOME)),(basename (realpath $KSCRIPT_HOME)) >> /tmp/autoenv-test.log
""" """
Then file /tmp/autoenv-test.log contains Then file /tmp/autoenv-test.log contains
""" """
1.10.1,1.3.0 1.10.1,1.6.0
1.9.9,1.2.11 1.9.9,1.5.0
1.9.7,1.3.0 1.9.7,1.6.0
1.10.1,1.3.0 1.10.1,1.6.0
""" """

View file

@ -5,7 +5,7 @@ Feature: Shell Completion
Given SDKMAN! candidate list is up to date Given SDKMAN! candidate list is up to date
And candidate ant is installed at version 1.9.9 And candidate ant is installed at version 1.9.9
And candidate ant is installed at version 1.10.1 And candidate ant is installed at version 1.10.1
And candidate crash is installed And candidate kscript is installed
Scenario: Command list correct Scenario: Command list correct
When the user enters " " into the prompt When the user enters " " into the prompt
@ -74,19 +74,19 @@ Feature: Shell Completion
Then completion should propose "<completions>" Then completion should propose "<completions>"
But completion should not propose <exclusions> But completion should not propose <exclusions>
Examples: Examples:
| cmd | completions | exclusions | | cmd | completions | exclusions |
| | ant, crash | gradle | | | ant, kscript | gradle |
| a | ant | gradle | | a | ant | gradle |
| j | | /.*/ | | j | | /.*/ |
| 1. | | /.*/ | | 1. | | /.*/ |
| an | ant | gradle, crash | # some installed | an | ant | gradle, kscript | # some installed
| gr | | /.*/ | # none installed | gr | | /.*/ | # none installed
| xyz | | /.*/ | # no such candidate | xyz | | /.*/ | # no such candidate
| 'an ' | | /.*/ | # no such candidate installed | 'an ' | | /.*/ | # no such candidate installed
| 'ant 1' | 1.10.1, 1.9.9 | /^\w+$/ | | 'ant 1' | 1.10.1, 1.9.9 | /^\w+$/ |
| 'ant 1.10.' | 1.10.1 | 1.9.9 | | 'ant 1.10.' | 1.10.1 | 1.9.9 |
| 'ant 2' | | /.*/ | | 'ant 2' | | /.*/ |
| 'ant 1.10.1 ' | | /.*/ | # only one version at a time | 'ant 1.10.1 ' | | /.*/ | # only one version at a time
Scenario Outline: Completion for 'list' Scenario Outline: Completion for 'list'
When the user enters "list <cmd>" into the prompt When the user enters "list <cmd>" into the prompt
@ -94,7 +94,7 @@ Feature: Shell Completion
But completion should not propose <exclusions> But completion should not propose <exclusions>
Examples: Examples:
| cmd | completions | exclusions | | cmd | completions | exclusions |
| an | ant | crash | | an | ant | kscript |
| xyz | | /.*/ | | xyz | | /.*/ |
| 1. | | /.*/ | | 1. | | /.*/ |
| 'ant ' | | /.*/ | | 'ant ' | | /.*/ |
@ -104,39 +104,39 @@ Feature: Shell Completion
Then completion should propose "<completions>" Then completion should propose "<completions>"
But completion should not propose <exclusions> But completion should not propose <exclusions>
Examples: Examples:
| cmd | completions | exclusions | | cmd | completions | exclusions |
| | ant, crash | gradle | | | ant, kscript | gradle |
| an | ant | crash, gradle | | an | ant | kscript, gradle |
| j | | /.*/ | | j | | /.*/ |
| 1. | | /.*/ | | 1. | | /.*/ |
| 'ant ' | 1.10.1, 1.9.9 | /^\w+$/ | | 'ant ' | 1.10.1, 1.9.9 | /^\w+$/ |
| 'ant 1.10.1 ' | | /.*/ | | 'ant 1.10.1 ' | | /.*/ |
Scenario Outline: Completion for 'default' Scenario Outline: Completion for 'default'
When the user enters "default <cmd>" into the prompt When the user enters "default <cmd>" into the prompt
Then completion should propose "<completions>" Then completion should propose "<completions>"
But completion should not propose <exclusions> But completion should not propose <exclusions>
Examples: Examples:
| cmd | completions | exclusions | | cmd | completions | exclusions |
| | ant, crash | gradle | | | ant, kscript | gradle |
| an | ant | crash, gradle | | an | ant | kscript, gradle |
| j | | /.*/ | | j | | /.*/ |
| 1. | | /.*/ | | 1. | | /.*/ |
| 'ant ' | 1.10.1, 1.9.9 | /^\w+$/ | | 'ant ' | 1.10.1, 1.9.9 | /^\w+$/ |
| 'ant 1.10.1 ' | | /.*/ | | 'ant 1.10.1 ' | | /.*/ |
Scenario Outline: Completion for 'home' Scenario Outline: Completion for 'home'
When the user enters "home <cmd>" into the prompt When the user enters "home <cmd>" into the prompt
Then completion should propose "<completions>" Then completion should propose "<completions>"
But completion should not propose <exclusions> But completion should not propose <exclusions>
Examples: Examples:
| cmd | completions | exclusions | | cmd | completions | exclusions |
| | ant, crash | gradle | | | ant, kscript | gradle |
| an | ant | crash, gradle | | an | ant | kscript, gradle |
| j | | /.*/ | | j | | /.*/ |
| 1. | | /.*/ | | 1. | | /.*/ |
| 'ant ' | 1.10.1, 1.9.9 | /^\w+$/ | | 'ant ' | 1.10.1, 1.9.9 | /^\w+$/ |
| 'ant 1.10.1 ' | | /.*/ | | 'ant 1.10.1 ' | | /.*/ |
Scenario Outline: Completion for 'env' Scenario Outline: Completion for 'env'
When the user enters "env <cmd>" into the prompt When the user enters "env <cmd>" into the prompt
@ -171,12 +171,12 @@ Feature: Shell Completion
Then completion should propose "<completions>" Then completion should propose "<completions>"
But completion should not propose <exclusions> But completion should not propose <exclusions>
Examples: Examples:
| cmd | completions | exclusions | | cmd | completions | exclusions |
| | ant, crash | gradle | | | ant, kscript | gradle |
| an | ant | crash, gradle | | an | ant | kscript, gradle |
| j | | /.*/ | | j | | /.*/ |
| 1. | | /.*/ | | 1. | | /.*/ |
| 'ant ' | | /^\w+$/ | | 'ant ' | | /^\w+$/ |
Scenario Outline: Completion for 'offline' Scenario Outline: Completion for 'offline'
When the user enters "offline <cmd>" into the prompt When the user enters "offline <cmd>" into the prompt

View file

@ -13,6 +13,6 @@ Feature: Corner Cases
# TODO: add test that fails if `test` in conf.d/sdk.fish:80 errors (cf issue #28 et al.) # TODO: add test that fails if `test` in conf.d/sdk.fish:80 errors (cf issue #28 et al.)
Scenario: PATH should contain only valid paths Scenario: PATH should contain only valid paths
Given candidate crash is installed Given candidate kscript is installed
When candidate crash is uninstalled When candidate kscript is uninstalled
Then environment variable PATH cannot contain "sdkman/candidates/crash/" Then environment variable PATH cannot contain "sdkman/candidates/kscript/"

View file

@ -24,6 +24,6 @@ Then(/^the output is$/) do |text|
expect(@response_fish_script).to eq(text.strip) expect(@response_fish_script).to eq(text.strip)
end end
Then(/^file ([a-zA-Z0-9-_.\/]+) contains$/) do |file,content| Then(/^file ([a-zA-Z0-9\-_.\/]+) contains$/) do |file,content|
expect(File.readlines(file).join("").strip).to eq(content.strip) expect(File.readlines(file).join("").strip).to eq(content.strip)
end end