mirror of https://github.com/hashicorp/packer
parent
f601625f7b
commit
ff23b67929
@ -0,0 +1,24 @@
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"cgl.tideland.biz/asserts"
|
||||
"os/exec"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCommand_NoExist(t *testing.T) {
|
||||
assert := asserts.NewTestingAsserts(t, true)
|
||||
|
||||
_, err := Command(exec.Command("i-should-never-ever-ever-exist"))
|
||||
assert.NotNil(err, "should have an error")
|
||||
}
|
||||
|
||||
func TestCommand_Good(t *testing.T) {
|
||||
assert := asserts.NewTestingAsserts(t, true)
|
||||
|
||||
command, err := Command(helperProcess("command"))
|
||||
assert.Nil(err, "should start command properly")
|
||||
|
||||
result := command.Synopsis()
|
||||
assert.Equal(result, "1", "should return result")
|
||||
}
|
||||
Loading…
Reference in new issue