Skip to content

Expectation slight rework - #14

Merged
DoubleNom merged 2 commits into
mainfrom
feature/expectations
Aug 5, 2026
Merged

Expectation slight rework#14
DoubleNom merged 2 commits into
mainfrom
feature/expectations

Conversation

@DoubleNom

@DoubleNom DoubleNom commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Handle requirements from expect-opt-extension.md
Goal is to remove chaining calls on Expect, to avoid odd behavior.

  • Migrate Not and OnErrorExtra to optional field for Expect. Deprecated older calls.
  • Remove Mandatory to policy for better fine tuning of error management.
  • Made matchers (ToBeXXX) calls to return ExpectationResult instead of Expectation
  • Made matchers to "consume" expectation, to prevent having multiple expectation with same ID/Name
  • Changed pass value to return the expectation success, taking inverted into account.
  • Update documentation
  • Update Unit Tests

Notes

  • I would rather remove Not and OnErrorExtra altogether immediately, rather than having deprecation warnings.
  • Ignored opt unknown fields checks

Goal is to remove chaining calls on Expect
Migrated Not, Mandatory and OnErrorExtra to optional field for Expect.
Deprecated older calls.
Made ToBeXXX calls to return ExpectationResult instead of Expectation
Changed pass value to return the expectation success, taking inverted into account. No need to check if expectation is inverted anymore.
Update unit tests
Update documentation
Change mandatory to policy to fine tune error management
Added consumed flag, to prevent retesting an expectation
@smartel99 smartel99 added the enhancement New feature or request label Aug 5, 2026
@DoubleNom
DoubleNom merged commit c01369a into main Aug 5, 2026
1 check passed
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.

2 participants