Skip to content

Consolidate withTemporaryDirectory test helper#123

Merged
sebsto merged 1 commit intomainfrom
sebsto/rationalize_test
Mar 3, 2026
Merged

Consolidate withTemporaryDirectory test helper#123
sebsto merged 1 commit intomainfrom
sebsto/rationalize_test

Conversation

@sebsto
Copy link
Owner

@sebsto sebsto commented Mar 3, 2026

Consolidates duplicate withTemporaryDirectory helper implementations into a single shared helper in TestHelpers.swift.

Changes:

  • Moved withTemporaryDirectory to shared TestHelpers.swift
  • Removed duplicate implementations from FileHandlerTests, ConfigHandlerTests, and DownloadDelegateTests
  • Added both sync and async variants with shared implementation
  • Extracted common logic into private createTemporaryDirectory helper
  • Updated all test files to use the global helper

This reduces code duplication and makes test helpers more maintainable. All tests compile and pass successfully.

@sebsto sebsto self-assigned this Mar 3, 2026
Copy link
Contributor

@amazon-q-developer amazon-q-developer bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The consolidation of withTemporaryDirectory helper functions is well-executed. The refactoring successfully eliminates code duplication across test files while maintaining identical functionality. The shared implementation in TestHelpers.swift properly handles both synchronous and asynchronous test cases with appropriate cleanup using defer blocks. All test files have been correctly updated to use the global helper. No blocking issues found.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@sebsto sebsto merged commit f734c7f into main Mar 3, 2026
5 checks passed
@sebsto sebsto deleted the sebsto/rationalize_test branch March 3, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant