Fix test running in non-bash shells

This commit is contained in:
Paul Banks 2018-02-22 14:06:06 +00:00
parent 0ee77a5e02
commit f7ecbce39a
No known key found for this signature in database
GPG Key ID: C25A851A849B8221
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ func TestMakeWatchHandler(t *testing.T) {
t.Parallel()
defer os.Remove("handler_out")
defer os.Remove("handler_index_out")
script := "echo $CONSUL_INDEX >> handler_index_out && cat >> handler_out"
script := "bash -c 'echo $CONSUL_INDEX >> handler_index_out && cat >> handler_out'"
handler := makeWatchHandler(os.Stderr, script)
handler(100, []string{"foo", "bar", "baz"})
raw, err := ioutil.ReadFile("handler_out")