1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
package config
import (
"fmt"
"testing"
)
func TestReadConfig(t *testing.T) {
fixture := []byte(`
[[rules]]
name = "Testing tests"
glob = "test*.test"
action = "put"
[[rules.pipeline]]
exec = "test -t $file"`)
cfg, err := NewConfig(fixture)
fmt.Printf("cfg: %+v\n", cfg.actionmap)
if err != nil || cfg == nil {
t.Errorf("Can't read %s file: %s", fixture, err)
}
}