Skip to content

Conversation

ericproulx
Copy link
Contributor

Fix #2491

Calls super if env is not defined
Add spec
@ericproulx ericproulx marked this pull request as ready for review September 1, 2024 11:50
@ericproulx ericproulx requested a review from dblock September 1, 2024 11:50
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits, thanks!

Is there a test one/you could write that gets us closer to the usage in the bug it fixes?

def inspect
return super unless env

"#{self.class} in `#{route.origin}' endpoint"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this meant to be quoted differently?

Suggested change
"#{self.class} in `#{route.origin}' endpoint"
"#{self.class} in '#{route.origin}' endpoint"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://bugs.ruby-lang.org/issues/16495
Looks like something cultural

@ericproulx
Copy link
Contributor Author

Some nits, thanks!

Is there a test one/you could write that gets us closer to the usage in the bug it fixes?

I've added a test that calls inspect on a Endpoint instance not related to an API call.

@dblock dblock merged commit 1cf4a80 into ruby-grape:master Sep 1, 2024
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.

Grape 2.1.x fail to compile, NoMethodError: undefined method []' for nil in grape/dsl/inside_route.rb:421:in route'

2 participants