chore: Fix ShellCheck errors in tests (#1452)

This commit is contained in:
Edwin Kofler 2023-01-25 05:37:21 -08:00 committed by GitHub
parent b45f12c617
commit ffa018763c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 17 additions and 11 deletions

View File

@ -22,7 +22,5 @@ shellcheck --shell bash --external-sources \
test/fixtures/dummy_legacy_plugin/bin/* \ test/fixtures/dummy_legacy_plugin/bin/* \
test/fixtures/dummy_plugin/bin/* test/fixtures/dummy_plugin/bin/*
# check .bats files shellcheck --shell bats --external-source \
# TODO(jthegedus): unlock this check later --severity warning test/*.bats
# TODO shellcheck --shell bats --external-sources \
# TODO test/*.bats

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bats #!/usr/bin/env bats
# shellcheck disable=SC2164
load test_helpers load test_helpers

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bats #!/usr/bin/env bats
# shellcheck disable=SC2164
load test_helpers load test_helpers

View File

@ -121,7 +121,7 @@ foobar 1.0.0 $PROJECT_DIR/.tool-versions"
run asdf current "y" run asdf current "y"
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[[ "$output" =~ "2.1.0" ]] [[ "$output" == *'2.1.0'* ]]
} }
@test "with no plugins prints an error" { @test "with no plugins prints an error" {

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bats #!/usr/bin/env bats
# shellcheck disable=SC2164
load test_helpers load test_helpers

View File

@ -33,8 +33,8 @@ foo http://example.com/foo"
run asdf plugin list all run asdf plugin list all
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[[ "$output" =~ "$expected_plugin_repo_sync" ]] [[ "$output" == *"$expected_plugin_repo_sync"* ]]
[[ "$output" =~ "$expected_plugins_list" ]] [[ "$output" == *"$expected_plugins_list"* ]]
} }
@test "plugin_list_all no immediate repo sync expected because check_duration is greater than 0" { @test "plugin_list_all no immediate repo sync expected because check_duration is greater than 0" {

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bats #!/usr/bin/env bats
# shellcheck disable=SC2164
load test_helpers load test_helpers
@ -57,7 +58,7 @@ teardown() {
run asdf env dummy run asdf env dummy
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
run grep 'FOO=bar' <(echo "$output") run grep 'FOO=bar' <<<"$output"
[ "$output" = "" ] [ "$output" = "" ]
[ "$status" -eq 1 ] [ "$status" -eq 1 ]
@ -78,6 +79,6 @@ teardown() {
[ "$path_line" != "" ] [ "$path_line" != "" ]
# Should not contain duplicate colon # Should not contain duplicate colon
run grep '::' <(echo "$path_line") run grep -q '::' <<<"$path_line"
[ "$duplicate_colon" = "" ] [ "$status" -ne 0 ]
} }

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bats #!/usr/bin/env bats
# shellcheck disable=SC2164
load test_helpers load test_helpers

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bats #!/usr/bin/env bats
# shellcheck disable=SC2164
load test_helpers load test_helpers

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bats #!/usr/bin/env bats
# shellcheck disable=SC2164
load test_helpers load test_helpers
@ -234,7 +235,7 @@ teardown() {
run find_versions "dummy" "$PROJECT_DIR" run find_versions "dummy" "$PROJECT_DIR"
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[[ "$output" =~ "0.1.0|$HOME/.dummy-version" ]] [[ "$output" == *"0.1.0|$HOME/.dummy-version"* ]]
} }
@test "get_preset_version_for returns the current version" { @test "get_preset_version_for returns the current version" {

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bats #!/usr/bin/env bats
# shellcheck disable=SC2164
load test_helpers load test_helpers