feat(tests): improve test coverage

This commit is contained in:
Chris Lane
2020-11-02 21:41:05 -05:00
parent a3ad8c5101
commit 0b21ccf6f8
6 changed files with 167 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
package config
import (
"testing"
)
// TestColor asserts that colorization rules are properly respected
func TestColor(t *testing.T) {
// mock a config
conf := Config{}
opts := map[string]interface{}{"--colorize": false}
if conf.Color(opts) {
t.Errorf("failed to respect --colorize (false)")
}
opts = map[string]interface{}{"--colorize": true}
if !conf.Color(opts) {
t.Errorf("failed to respect --colorize (true)")
}
}