Refine cuke of sdkman_auto_answer configuration on installation.

This commit is contained in:
Marco Vermeulen
2016-12-21 09:05:29 +00:00
parent dd8abad39f
commit e97ca5f72c
2 changed files with 17 additions and 6 deletions

View File

@@ -36,7 +36,7 @@ function __sdk_install {
__sdkman_determine_current_version "$candidate"
__sdkman_install_candidate_version "$candidate" "$VERSION" || return 1
if [[ "$sdkman_auto_answer" != 'true' && "$auto_answer_outdated" != 'true' && -n "$CURRENT"]]; then
if [[ "$sdkman_auto_answer" != 'true' && "$auto_answer_outdated" != 'true' && -n "$CURRENT" ]]; then
echo -n "Do you want ${candidate} ${VERSION} to be set as default? (Y/n): "
read USE
fi

View File

@@ -4,7 +4,7 @@ Feature: Install Candidate
Given the internet is reachable
And an initialised environment
Scenario: Install a default Candidate
Scenario: Install a default Candidate and set to default
Given the system is bootstrapped
And the candidate "grails" version "2.1.0" is a valid candidate version
And the default "grails" version is "2.1.0"
@@ -13,7 +13,7 @@ Feature: Install Candidate
And I do not see "Do you want grails 2.1.0 to be set as default? (Y/n)"
And the candidate "grails" version "2.1.0" is installed
Scenario: Install a specific Candidate
Scenario: Install a specific Candidate and set to default
Given the system is bootstrapped
And the candidate "grails" version "1.3.9" is available for download
When I enter "sdk install grails 1.3.9"
@@ -34,7 +34,7 @@ Feature: Install Candidate
When I enter "sdk install grails 1.3.9"
Then I see "Stop! grails 1.3.9 is already installed."
Scenario: Install a candidate and select to use it automatically
Scenario: Install a candidate and auto-answer to make it default
Given the system is bootstrapped
And the candidate "grails" version "2.1.0" is available for download
And I have configured "sdkman_auto_answer" to "true"
@@ -42,11 +42,22 @@ Feature: Install Candidate
Then the candidate "grails" version "2.1.0" is installed
And I do not see "Do you want grails 2.1.0 to be set as default?"
And I see "Done installing!"
And I do not see "Do you want grails 2.1.0 to be set as default? (Y/n)"
And I see "Setting grails 2.1.0 as default."
And the candidate "grails" version "2.1.0" should be the default
Scenario: Install a candidate and do not select to use it
Scenario: Install a candidate and choose to make it default
Given the candidate "grails" version "1.3.9" is already installed and default
And the system is bootstrapped
And the candidate "grails" version "2.1.0" is available for download
When I enter "sdk install grails 2.1.0" and answer "Y"
Then the candidate "grails" version "2.1.0" is installed
And I see "Done installing!"
And I see "Do you want grails 2.1.0 to be set as default? (Y/n)"
And I see "Setting grails 2.1.0 as default."
And the candidate "grails" version "2.1.0" should be the default
And the candidate "grails" version "1.3.9" should not be the default
Scenario: Install a candidate and choose not to make it default
Given the candidate "grails" version "1.3.9" is already installed and default
And the system is bootstrapped
And the candidate "grails" version "2.1.0" is available for download