summaryrefslogtreecommitdiff
path: root/worker/worker_test.go
blob: 805f66b57c4039348deff6a8ff4689c288681231 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package worker

import (
	"os/exec"
	"testing"

	"github.com/stretchr/testify/assert"
)

func Test_OnStarted(t *testing.T) {
	cmd := exec.Command("php", "tests/client.php", "broken", "pipes")
	assert.Nil(t, cmd.Start())

	w, err := InitBaseWorker(cmd)
	assert.Nil(t, w)
	assert.NotNil(t, err)

	assert.Equal(t, "can't attach to running process", err.Error())
}