github.com/joeky888/godog@v0.7.9/fmt_test.go (about) 1 package godog 2 3 import "testing" 4 5 func TestShouldFindFormatter(t *testing.T) { 6 cases := map[string]bool{ 7 "progress": true, // true means should be available 8 "unknown": false, 9 "junit": true, 10 "cucumber": true, 11 "pretty": true, 12 "custom": true, // is available for test purposes only 13 "undef": false, 14 } 15 16 for name, shouldFind := range cases { 17 actual := FindFmt(name) 18 if actual == nil && shouldFind { 19 t.Fatalf("expected %s formatter should be available", name) 20 } 21 if actual != nil && !shouldFind { 22 t.Fatalf("expected %s formatter should not be available", name) 23 } 24 } 25 }