Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnlon committed Jun 28, 2024
1 parent 9af0995 commit 078a136
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions internal/formatters/fmt_multi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

var (
mock = DummyFormatter{}
base = BaseFormatter{}

document = &messages.GherkinDocument{}
str = "theString"
Expand All @@ -27,6 +28,8 @@ func TestRepeater(t *testing.T) {
mock.tt = t
f := make(repeater, 0)
f = append(f, &mock)
f = append(f, &mock)
f = append(f, &base)

f.Feature(document, str, byt)
f.TestRunStarted()
Expand All @@ -39,17 +42,21 @@ func TestRepeater(t *testing.T) {
f.Pending(pickle, step, definition)
f.Ambiguous(pickle, step, definition, err)

assert.Equal(t, 1, mock.CountFeature)
assert.Equal(t, 1, mock.CountTestRunStarted, 1)
assert.Equal(t, 1, mock.CountPickle, 1)
assert.Equal(t, 1, mock.CountDefined, 1)
assert.Equal(t, 1, mock.CountPassed, 1)
assert.Equal(t, 1, mock.CountSkipped, 1)
assert.Equal(t, 1, mock.CountUndefined, 1)
assert.Equal(t, 1, mock.CountFailed, 1)
assert.Equal(t, 1, mock.CountPending, 1)
assert.Equal(t, 1, mock.CountAmbiguous, 1)
assert.Equal(t, 2, mock.CountFeature)
assert.Equal(t, 2, mock.CountTestRunStarted)
assert.Equal(t, 2, mock.CountPickle)
assert.Equal(t, 2, mock.CountDefined)
assert.Equal(t, 2, mock.CountPassed)
assert.Equal(t, 2, mock.CountSkipped)
assert.Equal(t, 2, mock.CountUndefined)
assert.Equal(t, 2, mock.CountFailed)
assert.Equal(t, 2, mock.CountPending)
assert.Equal(t, 2, mock.CountAmbiguous)

}

type BaseFormatter struct {
*Base
}

type DummyFormatter struct {
Expand Down

0 comments on commit 078a136

Please sign in to comment.