Skip to content

Conversation

@afuno
Copy link
Member

@afuno afuno commented Jan 1, 2026

No description provided.

- Introduced the `AlternativeService` module with customized error and result classes to simulate cross-service interactions.
- Implemented the `Usual::TestKit::Rspec` module to test relaxed and strict exception validation strategies for `.call` and `.call!` methods.
- Enhanced `MockExecutor` helper to differentiate validation strategies based on method type:
  - Relaxed validation for `.call` (accepts any `Servactory::Exceptions::Failure` subclass).
  - Strict validation for `.call!` (requires configured failure class).
- Added comprehensive RSpec test coverage to validate cross-service behavior and mocking flexibility.
@afuno afuno added this to the v.2.17.0 milestone Jan 1, 2026
@afuno afuno self-assigned this Jan 1, 2026
@afuno afuno added the fix label Jan 1, 2026
afuno added 4 commits January 1, 2026 20:55
- Corrected `rspec_context` parameter syntax in `MockExecutor` test cases by removing trailing colons.
- Ensured consistency across multiple test scenarios to prevent syntax-related issues.
- Updated context descriptions in `MockExecutor` RSpec tests to use more descriptive phrasing (e.g., "when using .call" instead of "for .call").
- Replaced inline variable definitions with `let` in `example1_spec` to align with RSpec conventions, improving readability and test consistency.
- Updated test cases to enhance failure service validation:
  - Added `.with`, `.type`, and `.meta` matchers for `ApplicationService::Exceptions::Failure`.
  - Improved accuracy by checking failure type and metadata.
- Enhanced exception validation for raised errors:
  - Verified exception type, message, and metadata consistency across tests.
- Improved test readability and debugging through stricter failure assertions.
- Improved `.call` test structure by reorganizing contexts for sibling and exact failure class mocking.
- Updated inline comments for better clarity on relaxed validation behavior.
- Ensured consistent formatting and alignment of test examples.
@afuno afuno marked this pull request as ready for review January 1, 2026 14:12
@afuno afuno merged commit 8c279db into main Jan 1, 2026
37 checks passed
@afuno afuno deleted the feature/SRV-374/specs branch January 1, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants