mirror of
https://github.com/jimeh/go-tmux.git
synced 2026-02-19 04:46:40 +00:00
feat: Initial working version of tmux package
This commit is contained in:
30
exec_runner_test.go
Normal file
30
exec_runner_test.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package tmux
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestExecRunnerRun(t *testing.T) {
|
||||
tests := []struct {
|
||||
command string
|
||||
args []string
|
||||
}{
|
||||
{command: "pwd"},
|
||||
{command: "hostname"},
|
||||
{command: "uname"},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
runner := &ExecRunner{}
|
||||
|
||||
expected, err := exec.Command(tt.command, tt.args...).CombinedOutput()
|
||||
assert.NoError(t, err)
|
||||
actual, err := runner.Run(tt.command, tt.args...)
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, expected, actual)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user