feat: Initial working version of tmux package

This commit is contained in:
2019-12-09 07:56:52 +00:00
commit 6f353d6d16
13 changed files with 471 additions and 0 deletions

30
exec_runner_test.go Normal file
View 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)
}
}