diff options
author | Wolfy-J <[email protected]> | 2018-01-23 19:51:15 -0500 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-01-23 19:51:15 -0500 |
commit | 78a42de837928cf7d10a1ae04d7e82e56d66e1e2 (patch) | |
tree | 8882b9a051bcc9c42328df583c0bb8c39a89591e /config_test.go | |
parent | fa4bd78d9f7c5f74e8445374370927c742fc4e78 (diff) |
API update
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..64bad7cb --- /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, "config.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, "config.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, "config.DestroyTimeout must be set", err.Error()) +} |