
* 042235c expose StepDef which is needed to formatters * e9474dc fix outline scenario formatting * f02c6ce fix comment position calculation for outlines * 5d7f128 remove step status type, use standard error
40 строки
1 001 Б
Go
40 строки
1 001 Б
Go
package godog
|
|
|
|
import "github.com/DATA-DOG/godog/gherkin"
|
|
|
|
type testFormatter struct {
|
|
features []*gherkin.Feature
|
|
scenarios []*gherkin.Scenario
|
|
|
|
failed []*failed
|
|
passed []*passed
|
|
skipped []*skipped
|
|
undefined []*undefined
|
|
}
|
|
|
|
func (f *testFormatter) Node(node interface{}) {
|
|
switch t := node.(type) {
|
|
case *gherkin.Feature:
|
|
f.features = append(f.features, t)
|
|
case *gherkin.Scenario:
|
|
f.scenarios = append(f.scenarios, t)
|
|
}
|
|
}
|
|
|
|
func (f *testFormatter) Summary() {}
|
|
|
|
func (f *testFormatter) Passed(step *gherkin.Step, match *StepDef) {
|
|
f.passed = append(f.passed, &passed{step: step, def: match})
|
|
}
|
|
|
|
func (f *testFormatter) Skipped(step *gherkin.Step) {
|
|
f.skipped = append(f.skipped, &skipped{step: step})
|
|
}
|
|
|
|
func (f *testFormatter) Undefined(step *gherkin.Step) {
|
|
f.undefined = append(f.undefined, &undefined{step: step})
|
|
}
|
|
|
|
func (f *testFormatter) Failed(step *gherkin.Step, match *StepDef, err error) {
|
|
f.failed = append(f.failed, &failed{step: step, def: match, err: err})
|
|
}
|