MCPcopy Create free account
hub / github.com/conforma/cli / theLogOutputShouldContain

Function theLogOutputShouldContain

acceptance/cli/cli.go:835–847  ·  view source on GitHub ↗

theLogOutputShouldContain checks if the log output (stderr) contains the expected text

(ctx context.Context, expected string)

Source from the content-addressed store, hash-verified

833
834// theLogOutputShouldContain checks if the log output (stderr) contains the expected text
835func theLogOutputShouldContain(ctx context.Context, expected string) error {
836 status, err := ecStatusFrom(ctx)
837 if err != nil {
838 return err
839 }
840
841 stderr := status.stderr.String()
842 if !strings.Contains(stderr, expected) {
843 return fmt.Errorf("expected log output to contain:\n%s\nbut stderr was:\n%s", expected, stderr)
844 }
845
846 return nil
847}
848
849// AddStepsTo adds Gherkin steps to the godog ScenarioContext
850func AddStepsTo(sc *godog.ScenarioContext) {

Callers

nothing calls this directly

Calls 3

ecStatusFromFunction · 0.85
ErrorfMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected