diff --git a/test/features/autoenv.feature b/test/features/autoenv.feature index f974643..bfe259f 100644 --- a/test/features/autoenv.feature +++ b/test/features/autoenv.feature @@ -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 """ diff --git a/test/features/completions.feature b/test/features/completions.feature index a06ff0b..9955fe1 100644 --- a/test/features/completions.feature +++ b/test/features/completions.feature @@ -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 "" But completion should not propose 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 " into the prompt @@ -94,7 +94,7 @@ Feature: Shell Completion But completion should not propose Examples: | cmd | completions | exclusions | - | an | ant | crash | + | an | ant | kscript | | xyz | | /.*/ | | 1. | | /.*/ | | 'ant ' | | /.*/ | @@ -104,39 +104,39 @@ Feature: Shell Completion Then completion should propose "" But completion should not propose 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 " into the prompt Then completion should propose "" But completion should not propose 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 " into the prompt Then completion should propose "" But completion should not propose 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 " into the prompt @@ -171,12 +171,12 @@ Feature: Shell Completion Then completion should propose "" But completion should not propose 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 " into the prompt diff --git a/test/features/corner_cases.feature b/test/features/corner_cases.feature index a2c211f..df27e43 100644 --- a/test/features/corner_cases.feature +++ b/test/features/corner_cases.feature @@ -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/" diff --git a/test/features/step_definitions/general.rb b/test/features/step_definitions/general.rb index 86f6aa6..32b1b9a 100644 --- a/test/features/step_definitions/general.rb +++ b/test/features/step_definitions/general.rb @@ -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