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

Better error message for missing let #441

Merged
merged 2 commits into from
Dec 3, 2021

Conversation

jaydorsey
Copy link
Contributor

@jaydorsey jaydorsey commented Aug 9, 2021

I've run into this a number of times, and helped developers triage this
as well. This is meant to improve the developer experience by providing
an improved error message when we forget to configure a let

The original error message is actually a NoMethodError/undefined method
and it's not always immediately clear what the solution is, particularly if
you're new to rspec/rswag

Here's an example error (the real one that prompted me to create this PR)

image

And the new error message:

image

I have a number of other small changes like this that I can contribute as well
if these types of pull requests are welcome.

@BookOfGreg BookOfGreg self-assigned this Sep 18, 2021
I've run into this problem a number of times. The original error message
is actually a `NoMethodError` and it's not always immediately clear what
the solution is, particuarly if you're new to rspec or rswag

Wanted to see if this kind of behavior is something that the rswag team
would be interested in adopting. I have a few other of these in mind
(will do as small PRs, with tests)
@jaydorsey
Copy link
Contributor Author

@BookOfGreg I updated with both fo your suggestions, and fixed the failing specs by doing a rebase/update. Let me know if you want any additional changes

@BookOfGreg BookOfGreg merged commit 9cfb5bc into rswag:master Dec 3, 2021
@jaydorsey jaydorsey deleted the jay/better_error_message branch December 5, 2021 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants