-
Notifications
You must be signed in to change notification settings - Fork 416
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
Add custom spec description option to run_test!
#622
Add custom spec description option to run_test!
#622
Conversation
b5ff355
to
18b1c26
Compare
Co-authored-by: Matt Polito <matt.polito@hashrocket.com> Co-authored-by: Tony Yunker <tony.yunker@hashrocket.com>
18b1c26
to
745d240
Compare
@romanblanco If rswag is in need of maintainer help. We can be of assistance. |
This is a great idea! I have a proposal of how we could do it slightly differently here: hashrocket#1 |
Co-authored-by: Matt Polito <matt.polito@hashrocket.com>
Updated PR with test-app scenario |
Hi @mattpolito, Roman pointed out your PR here on this project and I've chosen to grant you Write access to the project. |
@romanblanco now that you cut a release for 2.9.0, this is technically a breaking change. I was hoping it would make it in prior to the 'run_test!' options change. How would you like to handle this? |
@mattpolito, my plan is to review and release this and other PRs in 2.10.0 before merging #574 and other future changes for 3.0.0. I've tried to rebase your changes and run tests and everything is still passing. |
@romanblanco It's not a breaking change in code but in usage. However after thinking about how ruby would handle the args vs options, I believe it will be fine after-all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@mattpolito, @a-lavis, @ayunker, thanks for getting this done!
Problem
Specifications generated by
run_test!
are essentially a hard coded string of "returns a RESPONSE_CODE response". If you need to customize this you have to break down into the individual parts thatrun_test!
constructs for us.Solution
To facilitate configuration without the need to break out of the nicety that
run_test!
provides, we can now pass adescription
as the first argument.run_test!("custom specification description here")
A huge benefit to this is that when paired with auto generation of request/response examples, many example scenarios can be provided for documentation within the same
response
grouping.NOTE:
description
is not an allowable option to pass down to a specification, so we delete it vs forwarding down toit
.The changes I made are compatible with:
Checklist