diff options
author | Wolfy-J <[email protected]> | 2018-06-05 23:17:14 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-05 23:17:14 +0300 |
commit | e594c7070aad609c4caeda760671aca00e638561 (patch) | |
tree | b7ecb76ceeba88e03635c238a67f237452c20524 /config_test.go | |
parent | 6adaf713b47c9a3ab3a516e21d2d4ecf7f2075d6 (diff) |
fixing controlled descruction
Diffstat (limited to 'config_test.go')
-rw-r--r-- | config_test.go | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/config_test.go b/config_test.go new file mode 100644 index 00000000..f4c6246d --- /dev/null +++ b/config_test.go @@ -0,0 +1,40 @@ +package roadrunner + +import ( + "github.com/stretchr/testify/assert" + "testing" + "time" +) + +func Test_NumWorkers(t *testing.T) { + cfg := Config{ + AllocateTimeout: time.Second, + DestroyTimeout: time.Second * 10, + } + err := cfg.Valid() + + assert.NotNil(t, err) + assert.Equal(t, "cfg.NumWorkers must be set", err.Error()) +} + +func Test_AllocateTimeout(t *testing.T) { + cfg := Config{ + NumWorkers: 10, + DestroyTimeout: time.Second * 10, + } + err := cfg.Valid() + + assert.NotNil(t, err) + assert.Equal(t, "cfg.AllocateTimeout must be set", err.Error()) +} + +func Test_DestroyTimeout(t *testing.T) { + cfg := Config{ + NumWorkers: 10, + AllocateTimeout: time.Second, + } + err := cfg.Valid() + + assert.NotNil(t, err) + assert.Equal(t, "cfg.DestroyTimeout must be set", err.Error()) +} |