Skip to content

Conversation

@nevans
Copy link
Collaborator

@nevans nevans commented Oct 13, 2024

Backports #334 from master (0.5.0-dev).

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.
@nevans nevans force-pushed the backport/0.4/334/responses-return-frozen_dup branch from ca2e2c9 to 0c8df40 Compare October 13, 2024 12:35
@nevans nevans merged commit bb4a2c9 into v0.4-stable Oct 13, 2024
@nevans nevans deleted the backport/0.4/334/responses-return-frozen_dup branch October 13, 2024 12:42
@nevans nevans added backport This issue or PR is for a stable release branch enhancement New feature or request labels Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This issue or PR is for a stable release branch enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants