-
Notifications
You must be signed in to change notification settings - Fork 311
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
new integration spec for rails 7 exhibiting failure when executing de… #569
new integration spec for rails 7 exhibiting failure when executing de… #569
Conversation
…ep_<op>_keys on Hashie::Dash
Did you expect more failures than this one @aflansburg?
I think we should mark that spec pending with a link to the issue, update CHANGELOG saying we added an integration test for Rails 7, and merge this PR so we have it. That unless you can fix the issue? |
yeah that makes sense -> 9033f06
short on time atm, but happy to look into it when able |
@dblock not to muddy the waters with further commentary, but could this have something to do with this change here?
This would also impact |
I have looked into the failure here and while the example makes sense from a use perspective, the implementation is weird because Dash keys are always Symbols, but the test is doing I'm wondering what the correct behavior should be here - the expected behavior of failing to convert the keys, which is consistent with ActiveSupport's behavior? Or implicitly casting the result to a regular The latter would at least allow it to work, albeit inconsistently. The former doesn't make sense though because you wouldn't transform the keys of a Dash; that would make no sense since the entire point of a Dash is that it has coerced and validated keys. An alternative would be to disable or no-op In fact, this should probably be universal for A final alternative, and what I think might make the most sense would be to add a note to the readme for Dash that:
The downside to this approach is that there is undefined behavior for something like There isn't a pretty solution that I see. |
TL;DR - needing to use @michaelherold - personally, this seems very reasonable. Our use case is building request and response bodies using
|
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.
I made some nitpicky comments. I'd like to merge this, thanks for hanging in here!
CHANGELOG.md
Outdated
@@ -37,7 +37,7 @@ Any violations of this scheme are considered to be bugs. | |||
|
|||
### Miscellaneous | |||
|
|||
* Your contribution here. |
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.
Put this back please?
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.
My apologies - just circling back to this.
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.
CHANGELOG.md
Outdated
@@ -37,7 +37,7 @@ Any violations of this scheme are considered to be bugs. | |||
|
|||
### Miscellaneous | |||
|
|||
* Your contribution here. | |||
* [#569](https://github.com/hashie/hashie/pull/569): Added pending spec related to issue [#559](https://github.com/hashie/hashie/issues/559) when calling `#deep_transform_keys` on instance of `Hashie::Dash` w/ Rails 7 - [@aflansburg](https://github.com/aflansburg) |
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.
This is missing a period at the end.
I think the change should be "Added support for Rails 7" because by adding specs we say that we support it. There are bugs, but c'est la vie.
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.
|
||
context '#deep_transform_keys' do | ||
it 'sucessfully deep transforms keys' do | ||
class HashieDashKlass < Hashie::Dash |
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.
I think these are global. I would do this to avoid polluting namespaces:
let(:klass) do
Class.new(Hashie::Dash) do
property ...
end
end
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.
end | ||
|
||
context '#deep_transform_keys' do | ||
it 'sucessfully deep transforms keys' do |
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.
Move pending here, I think we use that pattern elsewhere, so pending "deep transforms keys"
.
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.
Fixed up CHANGELOG, put the issue number in pending spec and merged, thx. |
New integration spec for Rails 7 to exhibit failure mentioned in #559 when applying
deep_transform_keys
(or anydeep_<op>_keys
for that matter onHashie::Dash
or inheriting classes.