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

Formalize AddStep #53

Closed
sagikazarmark opened this issue Jan 17, 2020 · 1 comment · Fixed by #56
Closed

Formalize AddStep #53

sagikazarmark opened this issue Jan 17, 2020 · 1 comment · Fixed by #56
Labels
enhancement New feature or request

Comments

@sagikazarmark
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Currently the first parameter of AddStep allows passing various types:

  • string
  • []byte
  • *regexp.Regex

I think the API here could be improved a bit. It's easier to code when functions have definitive types.

Describe the solution you'd like
I think the most common usage is suite.AddStep(some string step definition), so I would make the first parameter string.

I don't really see why would anyone use a byte slice here. Are there any use cases for that? Maybe we could remove this one.

Finally I would add a suite.AddRegexStep function for accepting a regex instance.

Additional context
I understand this is just polishing, and in a testing use case using reflection doesn't matter that much, but having an easy to read and understand API makes using the library easier.

WDYT?

@sagikazarmark sagikazarmark added the enhancement New feature or request label Jan 17, 2020
@bkielbasa
Copy link
Collaborator

It makes sense to me. This behaviour is inspired by godog and to be honest I didn't like it as well :)
we can do that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants