diff --git a/run_test.go b/run_test.go index c79aff9..ffbc241 100644 --- a/run_test.go +++ b/run_test.go @@ -276,7 +276,7 @@ func TestFeatureFilePathParser(t *testing.T) { } } -func TestSucceedWithConcurrencyOption(t *testing.T) { +func TestSucceedWithProgressAndConcurrencyOption(t *testing.T) { output := new(bytes.Buffer) opt := Options{ @@ -312,3 +312,116 @@ func TestSucceedWithConcurrencyOption(t *testing.T) { t.Fatalf("unexpected output: \"%s\"", out) } } + +func TestSucceedWithJunitAndConcurrencyOption(t *testing.T) { + output := new(bytes.Buffer) + + opt := Options{ + Format: "junit", + NoColors: true, + Paths: []string{"features"}, + Concurrency: 2, + Output: output, + } + + expectedOutput := ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +` + + status := RunWithOptions("succeed", func(s *Suite) { SuiteContext(s) }, opt) + if status != exitSuccess { + t.Fatalf("expected exit status to be 0, but was: %d", status) + } + + b, err := ioutil.ReadAll(output) + if err != nil { + t.Fatal(err) + } + + out := strings.TrimSpace(string(b)) + if out != expectedOutput { + t.Fatalf("unexpected output: \"%s\"", out) + } +}