mirror of
https://github.com/ethauvin/sdkman-for-fish.git
synced 2025-04-25 05:17:11 -07:00
fix(test): Use kscript as test candidate
instead of crash, which doesn't exist anymore
This commit is contained in:
parent
1b2824d37f
commit
e9f967501c
4 changed files with 57 additions and 57 deletions
|
@ -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.9
|
||||
And candidate ant is installed at version 1.10.1
|
||||
And candidate crash is installed at version 1.2.11
|
||||
And candidate crash is installed at version 1.3.0
|
||||
And candidate kscript is installed at version 1.5.0
|
||||
And candidate kscript is installed at version 1.6.0
|
||||
|
||||
Scenario: No action if autoenv turned off
|
||||
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
|
||||
"""
|
||||
ant=1.9.9
|
||||
crash=1.2.11
|
||||
kscript=1.5.0
|
||||
"""
|
||||
And file /tmp/autoenv-test-2/.sdkmanrc exists with content
|
||||
"""
|
||||
|
@ -67,18 +67,18 @@ Feature: Support autoenv setting
|
|||
"""
|
||||
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
|
||||
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
|
||||
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 ..
|
||||
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
|
||||
"""
|
||||
1.10.1,1.3.0
|
||||
1.9.9,1.2.11
|
||||
1.9.7,1.3.0
|
||||
1.10.1,1.3.0
|
||||
1.10.1,1.6.0
|
||||
1.9.9,1.5.0
|
||||
1.9.7,1.6.0
|
||||
1.10.1,1.6.0
|
||||
"""
|
||||
|
|
|
@ -5,7 +5,7 @@ Feature: Shell Completion
|
|||
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.10.1
|
||||
And candidate crash is installed
|
||||
And candidate kscript is installed
|
||||
|
||||
Scenario: Command list correct
|
||||
When the user enters " " into the prompt
|
||||
|
@ -74,19 +74,19 @@ Feature: Shell Completion
|
|||
Then completion should propose "<completions>"
|
||||
But completion should not propose <exclusions>
|
||||
Examples:
|
||||
| cmd | completions | exclusions |
|
||||
| | ant, crash | gradle |
|
||||
| a | ant | gradle |
|
||||
| j | | /.*/ |
|
||||
| 1. | | /.*/ |
|
||||
| an | ant | gradle, crash | # some installed
|
||||
| gr | | /.*/ | # none installed
|
||||
| xyz | | /.*/ | # no such candidate
|
||||
| 'an ' | | /.*/ | # no such candidate installed
|
||||
| 'ant 1' | 1.10.1, 1.9.9 | /^\w+$/ |
|
||||
| 'ant 1.10.' | 1.10.1 | 1.9.9 |
|
||||
| 'ant 2' | | /.*/ |
|
||||
| 'ant 1.10.1 ' | | /.*/ | # only one version at a time
|
||||
| cmd | completions | exclusions |
|
||||
| | ant, kscript | gradle |
|
||||
| a | ant | gradle |
|
||||
| j | | /.*/ |
|
||||
| 1. | | /.*/ |
|
||||
| an | ant | gradle, kscript | # some installed
|
||||
| gr | | /.*/ | # none installed
|
||||
| xyz | | /.*/ | # no such candidate
|
||||
| 'an ' | | /.*/ | # no such candidate installed
|
||||
| 'ant 1' | 1.10.1, 1.9.9 | /^\w+$/ |
|
||||
| 'ant 1.10.' | 1.10.1 | 1.9.9 |
|
||||
| 'ant 2' | | /.*/ |
|
||||
| 'ant 1.10.1 ' | | /.*/ | # only one version at a time
|
||||
|
||||
Scenario Outline: Completion for 'list'
|
||||
When the user enters "list <cmd>" into the prompt
|
||||
|
@ -94,7 +94,7 @@ Feature: Shell Completion
|
|||
But completion should not propose <exclusions>
|
||||
Examples:
|
||||
| cmd | completions | exclusions |
|
||||
| an | ant | crash |
|
||||
| an | ant | kscript |
|
||||
| xyz | | /.*/ |
|
||||
| 1. | | /.*/ |
|
||||
| 'ant ' | | /.*/ |
|
||||
|
@ -104,39 +104,39 @@ Feature: Shell Completion
|
|||
Then completion should propose "<completions>"
|
||||
But completion should not propose <exclusions>
|
||||
Examples:
|
||||
| cmd | completions | exclusions |
|
||||
| | ant, crash | gradle |
|
||||
| an | ant | crash, gradle |
|
||||
| j | | /.*/ |
|
||||
| 1. | | /.*/ |
|
||||
| 'ant ' | 1.10.1, 1.9.9 | /^\w+$/ |
|
||||
| 'ant 1.10.1 ' | | /.*/ |
|
||||
| cmd | completions | exclusions |
|
||||
| | ant, kscript | gradle |
|
||||
| an | ant | kscript, gradle |
|
||||
| j | | /.*/ |
|
||||
| 1. | | /.*/ |
|
||||
| 'ant ' | 1.10.1, 1.9.9 | /^\w+$/ |
|
||||
| 'ant 1.10.1 ' | | /.*/ |
|
||||
|
||||
Scenario Outline: Completion for 'default'
|
||||
When the user enters "default <cmd>" into the prompt
|
||||
Then completion should propose "<completions>"
|
||||
But completion should not propose <exclusions>
|
||||
Examples:
|
||||
| cmd | completions | exclusions |
|
||||
| | ant, crash | gradle |
|
||||
| an | ant | crash, gradle |
|
||||
| j | | /.*/ |
|
||||
| 1. | | /.*/ |
|
||||
| 'ant ' | 1.10.1, 1.9.9 | /^\w+$/ |
|
||||
| 'ant 1.10.1 ' | | /.*/ |
|
||||
| cmd | completions | exclusions |
|
||||
| | ant, kscript | gradle |
|
||||
| an | ant | kscript, gradle |
|
||||
| j | | /.*/ |
|
||||
| 1. | | /.*/ |
|
||||
| 'ant ' | 1.10.1, 1.9.9 | /^\w+$/ |
|
||||
| 'ant 1.10.1 ' | | /.*/ |
|
||||
|
||||
Scenario Outline: Completion for 'home'
|
||||
When the user enters "home <cmd>" into the prompt
|
||||
Then completion should propose "<completions>"
|
||||
But completion should not propose <exclusions>
|
||||
Examples:
|
||||
| cmd | completions | exclusions |
|
||||
| | ant, crash | gradle |
|
||||
| an | ant | crash, gradle |
|
||||
| j | | /.*/ |
|
||||
| 1. | | /.*/ |
|
||||
| 'ant ' | 1.10.1, 1.9.9 | /^\w+$/ |
|
||||
| 'ant 1.10.1 ' | | /.*/ |
|
||||
| cmd | completions | exclusions |
|
||||
| | ant, kscript | gradle |
|
||||
| an | ant | kscript, gradle |
|
||||
| j | | /.*/ |
|
||||
| 1. | | /.*/ |
|
||||
| 'ant ' | 1.10.1, 1.9.9 | /^\w+$/ |
|
||||
| 'ant 1.10.1 ' | | /.*/ |
|
||||
|
||||
Scenario Outline: Completion for 'env'
|
||||
When the user enters "env <cmd>" into the prompt
|
||||
|
@ -171,12 +171,12 @@ Feature: Shell Completion
|
|||
Then completion should propose "<completions>"
|
||||
But completion should not propose <exclusions>
|
||||
Examples:
|
||||
| cmd | completions | exclusions |
|
||||
| | ant, crash | gradle |
|
||||
| an | ant | crash, gradle |
|
||||
| j | | /.*/ |
|
||||
| 1. | | /.*/ |
|
||||
| 'ant ' | | /^\w+$/ |
|
||||
| cmd | completions | exclusions |
|
||||
| | ant, kscript | gradle |
|
||||
| an | ant | kscript, gradle |
|
||||
| j | | /.*/ |
|
||||
| 1. | | /.*/ |
|
||||
| 'ant ' | | /^\w+$/ |
|
||||
|
||||
Scenario Outline: Completion for 'offline'
|
||||
When the user enters "offline <cmd>" into the prompt
|
||||
|
|
|
@ -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.)
|
||||
|
||||
Scenario: PATH should contain only valid paths
|
||||
Given candidate crash is installed
|
||||
When candidate crash is uninstalled
|
||||
Then environment variable PATH cannot contain "sdkman/candidates/crash/"
|
||||
Given candidate kscript is installed
|
||||
When candidate kscript is uninstalled
|
||||
Then environment variable PATH cannot contain "sdkman/candidates/kscript/"
|
||||
|
|
|
@ -24,6 +24,6 @@ Then(/^the output is$/) do |text|
|
|||
expect(@response_fish_script).to eq(text.strip)
|
||||
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)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue