mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
22 lines
372 B
Go
22 lines
372 B
Go
package process
|
|
|
|
import (
|
|
"github.com/stretchr/testify/require"
|
|
"os/exec"
|
|
"testing"
|
|
)
|
|
|
|
func TestDaemon(t *testing.T) {
|
|
d := NewProcessDaemon(func() *exec.Cmd {
|
|
return exec.Command("echo", "hello")
|
|
})
|
|
err := d.Start()
|
|
require.Nil(t, err)
|
|
|
|
d = NewProcessDaemon(func() *exec.Cmd {
|
|
return exec.Command("return", "1")
|
|
})
|
|
err = d.Start()
|
|
require.NotNil(t, err)
|
|
}
|