Skip to content

Commit 2cbcc70

Browse files
committed
refactor: enhance code coverage
1 parent 2f64c55 commit 2cbcc70

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

spawn_config_test.go

+11-5
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,15 @@ import (
3232
)
3333

3434
func TestSpawnOption(t *testing.T) {
35-
config := &spawnConfig{}
36-
second := time.Second
37-
option := WithPassivateAfter(second)
38-
option.Apply(config)
39-
require.Equal(t, &spawnConfig{passivateAfter: second}, config)
35+
t.Run("WithPassivateAfter with options", func(t *testing.T) {
36+
config := newSpawnConfig(WithPassivateAfter(time.Second))
37+
require.EqualValues(t, time.Second, config.passivateAfter)
38+
})
39+
t.Run("WithPassivateAfter with Apply", func(t *testing.T) {
40+
config := &spawnConfig{}
41+
second := time.Second
42+
option := WithPassivateAfter(second)
43+
option.Apply(config)
44+
require.Equal(t, &spawnConfig{passivateAfter: second}, config)
45+
})
4046
}

0 commit comments

Comments
 (0)