use `prefix` instead of `HOMEBREW_PREFIX`
fully specify the binary path in the test
use a &> redirect instead of two separate redirects