godog/fmt_test.go
Matthew Rothenberg 2b109b5ea8 move SuiteContext out of _test namespace
This allows it to be easily re-used in other libraries to do
meta-testing on their own godog features/steps.

At some point it may make sense to migrate this entirely to a
sub-package of godog, however that would require a larger
re-architecting of the project structure to avoid circular dependencies
(e.g. `import cycle not allowed`).
2017-05-05 11:40:35 -04:00

25 строки
603 Б
Go

package godog
import "testing"
func TestShouldFindFormatter(t *testing.T) {
cases := map[string]bool{
"progress": true, // true means should be available
"unknown": false,
"junit": true,
"cucumber": true,
"pretty": true,
"custom": true, // is available for test purposes only
"undef": false,
}
for name, shouldFind := range cases {
actual := findFmt(name)
if actual == nil && shouldFind {
t.Fatalf("expected %s formatter should be available", name)
}
if actual != nil && !shouldFind {
t.Fatalf("expected %s formatter should not be available", name)
}
}
}