Skip to content

feat: support auto converting doc strings to plain strings#380

Merged
lonnblad merged 1 commit intocucumber:masterfrom
chirino:doc-string-convert
Mar 16, 2021
Merged

feat: support auto converting doc strings to plain strings#380
lonnblad merged 1 commit intocucumber:masterfrom
chirino:doc-string-convert

Conversation

@chirino
Copy link
Copy Markdown
Contributor

@chirino chirino commented Mar 9, 2021

This PR allows you to implement the following step:

  Scenario: example
    Given call with:
    """
    text
    """

with a simpler function signature like:

ctx.Step(`^call with:$`, func(arg string) error {
	return nil
})

vs. what you have to do now which is:

ctx.Step(`^call with:$`, func(arg *godog.DocString) error {
	return nil
})

@chirino chirino force-pushed the doc-string-convert branch from 57f8f8a to a9409d9 Compare March 9, 2021 19:10
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 9, 2021

Codecov Report

Merging #380 (80eb14d) into master (3589a9b) will increase coverage by 0.09%.
The diff coverage is 62.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #380      +/-   ##
==========================================
+ Coverage   81.03%   81.13%   +0.09%     
==========================================
  Files          25       25              
  Lines        1993     1998       +5     
==========================================
+ Hits         1615     1621       +6     
+ Misses        275      274       -1     
  Partials      103      103              
Impacted Files Coverage Δ
internal/models/stepdef.go 61.06% <62.50%> (+2.72%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3589a9b...80eb14d. Read the comment docs.

@lonnblad
Copy link
Copy Markdown
Member

lonnblad commented Mar 9, 2021

Hi @chirino, thanks for the contribution!

Could you add a test in this file as well.
https://github.com/cucumber/godog/blob/master/internal/models/stepdef_test.go

Thanks!
BR Fredrik

@chirino chirino force-pushed the doc-string-convert branch from a9409d9 to 80eb14d Compare March 13, 2021 04:04
@chirino
Copy link
Copy Markdown
Contributor Author

chirino commented Mar 13, 2021

ok test added.

@lonnblad lonnblad merged commit 2b6c9dc into cucumber:master Mar 16, 2021
@aslakhellesoy
Copy link
Copy Markdown
Contributor

Hi @chirino,

Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾

In return for this generous offer we hope you will:

  • ✅ Continue to use branches and pull requests. When someone on the core team approves a pull request (yours or someone else's), you're welcome to merge it yourself.
  • 💚 Commit to setting a good example by following and upholding our code of conduct in your interactions with other collaborators and users.
  • 💬 Join the community Slack channel to meet the rest of the team and make yourself at home.
  • ℹ️ Don't feel obliged to help, just do what you can if you have the time and the energy.
  • 🙋 Ask if you need anything. We're looking for feedback about how to make the project more welcoming, so please tell us!

On behalf of the Cucumber core team,
Aslak Hellesøy
Creator of Cucumber

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants