test(fish): Improve test isolation (#1708)

This commit is contained in:
Edwin Kofler 2024-01-19 00:38:06 -08:00 committed by GitHub
parent 53276973f7
commit b8ecf71d77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,7 +16,7 @@ cleaned_path() {
} }
@test "exports ASDF_DIR" { @test "exports ASDF_DIR" {
run fish -c " run fish --no-config -c "
set -e asdf set -e asdf
set -e ASDF_DIR set -e ASDF_DIR
set -e ASDF_DATA_DIR set -e ASDF_DATA_DIR
@ -30,7 +30,7 @@ cleaned_path() {
} }
@test "adds asdf dirs to PATH" { @test "adds asdf dirs to PATH" {
run fish -c " run fish --no-config -c "
set -e asdf set -e asdf
set -e ASDF_DIR set -e ASDF_DIR
set -e ASDF_DATA_DIR set -e ASDF_DATA_DIR
@ -46,7 +46,7 @@ cleaned_path() {
} }
@test "does not add paths to PATH more than once" { @test "does not add paths to PATH more than once" {
run fish -c " run fish --no-config -c "
set -e asdf set -e asdf
set -e ASDF_DIR set -e ASDF_DIR
set -e ASDF_DATA_DIR set -e ASDF_DATA_DIR
@ -63,7 +63,7 @@ cleaned_path() {
} }
@test "defines the asdf function" { @test "defines the asdf function" {
run fish -c " run fish --no-config -c "
set -e asdf set -e asdf
set -e ASDF_DIR set -e ASDF_DIR
set PATH $(cleaned_path) set PATH $(cleaned_path)
@ -76,7 +76,7 @@ cleaned_path() {
} }
@test "function calls asdf command" { @test "function calls asdf command" {
run fish -c " run fish --no-config -c "
set -e asdf set -e asdf
set -x ASDF_DIR $(pwd) # checkstyle-ignore set -x ASDF_DIR $(pwd) # checkstyle-ignore
set PATH $(cleaned_path) set PATH $(cleaned_path)