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

Should hash keys be sorted? #30

Open
mcmire opened this issue Sep 12, 2019 · 1 comment
Open

Should hash keys be sorted? #30

mcmire opened this issue Sep 12, 2019 · 1 comment

Comments

@mcmire
Copy link
Collaborator

mcmire commented Sep 12, 2019

We already sort keys for ActiveRecord::Base instances, so it may make sense to sort hash keys too.

@mcmire
Copy link
Collaborator Author

mcmire commented Dec 31, 2022

Thinking about this some more, I don't think hash keys should ever be sorted. I think we should use the expected value as the source of truth for how keys should appear, because oftentimes you're looking at a failing test and comparing the output to what you've written. In other words you don't know what the actual value is, but you do know what the expected value is (because you wrote it).

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

No branches or pull requests

1 participant