mirror of
https://github.com/cheat/cheat.git
synced 2024-11-16 17:08:29 +01:00
22 lines
437 B
Go
22 lines
437 B
Go
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)")
|
|
}
|
|
}
|