Skip to content

Commit 5ba9f30

Browse files
committed
existence: Fix tests on FreeBSD by removing PATH
Thought I'd make the test more hermetic by setting `PATH` explicitly, but forgot that Bash is installed under `/usr/local/bin` on FreeBSD. Hopefully no one will have any actual programs named foo, bar, or baz on their system.
1 parent f495845 commit 5ba9f30

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/existence.bats

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,35 +53,35 @@ teardown() {
5353
'else' \
5454
' exit 1' \
5555
'fi'
56-
PATH="$BATS_TEST_BINDIR:/bin" run "$TEST_GO_SCRIPT" 'foo' 'bar' 'baz'
56+
run "$TEST_GO_SCRIPT" 'foo' 'bar' 'baz'
5757
assert_failure "None of the following commands were found on the system:" \
5858
' foo' \
5959
' bar' \
6060
' baz'
6161

6262
stub_program_in_path 'baz'
63-
PATH="$BATS_TEST_BINDIR:/bin" run "$TEST_GO_SCRIPT" 'foo' 'bar' 'baz'
63+
run "$TEST_GO_SCRIPT" 'foo' 'bar' 'baz'
6464
assert_success 'baz'
6565

6666
stub_program_in_path 'bar'
67-
PATH="$BATS_TEST_BINDIR:/bin" run "$TEST_GO_SCRIPT" 'foo' 'bar' 'baz'
67+
run "$TEST_GO_SCRIPT" 'foo' 'bar' 'baz'
6868
assert_success 'bar'
6969

7070
stub_program_in_path 'foo'
71-
PATH="$BATS_TEST_BINDIR:/bin" run "$TEST_GO_SCRIPT" 'foo' 'bar' 'baz'
71+
run "$TEST_GO_SCRIPT" 'foo' 'bar' 'baz'
7272
assert_success 'foo'
7373
}
7474

7575
@test "$SUITE: check_command_installed" {
7676
@go.create_test_go_script '. "$_GO_USE_MODULES" "existence"' \
7777
'@go.check_command_installed "$@"'
78-
PATH="$BATS_TEST_BINDIR:/bin" run "$TEST_GO_SCRIPT" 'foobar'
78+
run "$TEST_GO_SCRIPT" 'foobar'
7979
assert_failure 'Please install foobar on your system and try again.'
8080

81-
PATH="$BATS_TEST_BINDIR:/bin" run "$TEST_GO_SCRIPT" 'foobar' 'Foo Bar'
81+
run "$TEST_GO_SCRIPT" 'foobar' 'Foo Bar'
8282
assert_failure 'Please install Foo Bar on your system and try again.'
8383

8484
stub_program_in_path 'foobar'
85-
PATH="$BATS_TEST_BINDIR:/bin" run "$TEST_GO_SCRIPT" 'foobar' 'Foo Bar'
85+
run "$TEST_GO_SCRIPT" 'foobar' 'Foo Bar'
8686
assert_success ''
8787
}

0 commit comments

Comments
 (0)