Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctx.GetError should not return err if there's nil #93

Closed
bkielbasa opened this issue May 8, 2020 · 0 comments · Fixed by #94
Closed

ctx.GetError should not return err if there's nil #93

bkielbasa opened this issue May 8, 2020 · 0 comments · Fixed by #94
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@bkielbasa
Copy link
Collaborator

Describe the bug

Here's sample code:

func itReturnsNoError(t gobdd.StepTest, ctx context.Context) context.Context {
	res, err := ctx.GetError(statsErrKey{})
	if err != nil {
		t.Error(err)
	}
	if res != nil {
		t.Errorf("expected no error but %+v received", res)
	}
	
	return ctx
}

When I want to check if the GetError returns an error, sometimes I want to get nil from it. But, in such case the GetError will return the err as the second returned value. It should be nil as well.

@bkielbasa bkielbasa added bug Something isn't working good first issue Good for newcomers labels May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant