Skip to content

Conversation

@nevans
Copy link
Collaborator

@nevans nevans commented Sep 3, 2025

The Test::Unit::TestCase monkeypatch has been converted into a Net::IMAP::TestCase subclass of Test::Unit::TestCase. Common #setup and #teardown has been moved into that class.

The test/net/imap/test_imap_* files are all client integration tests that create a fake server socket and connect to it, testing a method or a cluster of methods on Net::IMAP. All other test files are (or should be) for a specific class or module. Several files and TestCase classes were renamed to be consistent with this.

Most of the tests in test/net/imap/test_imap.rb have been moved into files specific to a method of cluster of methods on Net::IMAP. Some connected integration tests on Net::IMAP were already in their own files specific to a method of cluster of methods, but new files were created for the following methods:

  • #authenticate
  • #close and #unselect
  • #enable
  • #expunge and #uid_expunge
  • #fetch and #uid_fetch
  • #search and #uid_search
  • #select and #examine
  • #store and #uid_store
  • UIDPLUS extension (not based on specific methods and may be moved/renamed)

nevans added 4 commits August 29, 2025 14:58
The `test/net/imap/test_imap_*` files are all client integration tests
that create a fake server socket and connect to it, testing a method or
a cluster of methods on `Net::IMAP`.  All other test files are for unit
tests for a specific class or module.
Many of the tests that remain in `test_imap` are connection related or
edge cases, e.g: unexpected EOF, STARTTLS stripping, TLS with CA file,
send_command argument translation.  Those will probably stay in this
file indefinitely.  But some of them simply haven't been translated to
`with_fake_server` yet and thus can't easily be moved, e.g: the tests
for idle, disconnect, append, id.  Those will be moved eventually.
@nevans
Copy link
Collaborator Author

nevans commented Sep 3, 2025

If you have git diff configured in your terminal to show different colors for moved lines of code (rather than just using the same colors for deleted/added), you can verify that the vast majority of changes in this PR were verbatim moves. Unfortunately, github (still) doesn't have any easy way to see that in their diff views.

@nevans nevans merged commit bd0d1b2 into master Sep 3, 2025
37 checks passed
@nevans nevans deleted the organize-tests branch September 3, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants