✨ New config option to return frozen dup from #responses [backport: #334]#339
Merged
nevans merged 8 commits intoOct 13, 2024
Merged
Conversation
I tried using markdown for the tables, but it screwed up other formatting. This format (with definition lists) is more "standard" for rdoc.
`test_imap.rb` is huge! `wait_for_response_count` was moved into TestCase (in test/lib/helper). Perhaps this should be moved into a shared module or an IMAPTestCase class (subclass of TestCase) instead?
Two args (counting the block arg) => four tests. Only the original (no args) form is affected by `config.responses_without_block`, so the others make their assertions for every possible config setting.
The same message is used for both the warning and the ArgumentError.
Because responses(type) is relatively new and has always raised an exception, we can update it to return a frozen dup array without breaking backward compatibility. Additionally, `config.responses_without_args` was added as an alias for `config.responses_without_block`. The original name is a little misleading now, but it's kept for backward compatibility.
This adds a new `:frozen_dup` option to `config.responses_without_block` which allows it to return a frozen copy of the responses hash, with each response type array also being a frozen copy.
This seems like a better API than _always_ crashing. Now that we have a config option for it, it should become the default in v0.6.
ca2e2c9 to
0c8df40
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports #334 from
master(0.5.0-dev).