Skip to content

refactor!: Change assertion traits to define spec-like return types as associated types#80

Merged
haraldmaida merged 1 commit intomainfrom
refactor/associated-type-for-assertion-traits-as-return-type-for-assertion-methods
Mar 28, 2026
Merged

refactor!: Change assertion traits to define spec-like return types as associated types#80
haraldmaida merged 1 commit intomainfrom
refactor/associated-type-for-assertion-traits-as-return-type-for-assertion-methods

Conversation

@haraldmaida
Copy link
Copy Markdown
Member

@haraldmaida haraldmaida commented Mar 28, 2026

Currently some assertion traits define "mapping" assertion methods. These are methods that do not return Self, but a Spec holding a different subject as a result of mapping the original subject.

This API shall be more flexible in that the implementor can define the concrete return type. Therefore assertion traits where the methods have a return type other than Self shall use associated types as the methods return types. This allows that the implementor can define the concrete return types.

This refactoring is also a necessary preparation for upcoming more advanced features of asserting.

BREAKING: as the definition of some assertion traits are changed, any custom implementations of the refactored assertion traits must be adapted.

…by mapping assertion methods as associated type
@haraldmaida haraldmaida changed the title refactor: Change assertion traits to define spec-like return types as associated types refactor!: Change assertion traits to define spec-like return types as associated types Mar 28, 2026
@haraldmaida haraldmaida self-assigned this Mar 28, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.85%. Comparing base (62eb4c9) to head (51a9394).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #80      +/-   ##
==========================================
- Coverage   92.86%   92.85%   -0.01%     
==========================================
  Files          41       41              
  Lines        5759     5756       -3     
  Branches     5759     5756       -3     
==========================================
- Hits         5348     5345       -3     
  Misses        345      345              
  Partials       66       66              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@haraldmaida haraldmaida added the enhancement New feature or request label Mar 28, 2026
@haraldmaida haraldmaida merged commit a106728 into main Mar 28, 2026
11 of 12 checks passed
@haraldmaida haraldmaida deleted the refactor/associated-type-for-assertion-traits-as-return-type-for-assertion-methods branch March 28, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant