Skip to content

Commit f22ac64

Browse files
committed
Update tmuxp config constructor
1 parent b456944 commit f22ac64

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

pkg/tmuxp/tmuxp.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package tmuxp
22

3-
import "io"
3+
import (
4+
"github.com/arunvelsriram/kube-tmuxp/pkg/filesystem"
5+
)
46

57
// Window represents a window in a tmux session
68
type Window struct {
@@ -19,12 +21,15 @@ type Config struct {
1921
SessionName string
2022
Windows
2123
Environment
22-
writer io.Writer
24+
filesystem filesystem.FileSystem
2325
}
2426

2527
// New returns a new tmuxp config
26-
func New(writer io.Writer) Config {
28+
func New(sessionName string, windows Windows, environment Environment, fs filesystem.FileSystem) Config {
2729
return Config{
28-
writer: writer,
30+
SessionName: sessionName,
31+
Windows: windows,
32+
Environment: environment,
33+
filesystem: fs,
2934
}
3035
}

pkg/tmuxp/tmuxp_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
package tmuxp_test
22

33
import (
4-
"io"
54
"testing"
65

6+
"github.com/arunvelsriram/kube-tmuxp/pkg/filesystem"
77
"github.com/arunvelsriram/kube-tmuxp/pkg/tmuxp"
88
"github.com/stretchr/testify/assert"
99
)
1010

1111
func TestNew(t *testing.T) {
12-
var writer io.Writer
13-
tmuxpCfg := tmuxp.New(writer)
12+
tmuxpCfg := tmuxp.New("session", tmuxp.Windows{}, tmuxp.Environment{}, &filesystem.Default{})
1413

1514
assert.NotNil(t, tmuxpCfg)
1615
}

0 commit comments

Comments
 (0)