Skip to content

Add assert_unsuccessful_code function#506

Merged
Chemaclass merged 1 commit into
mainfrom
feat/505-new-assert-unsuccessful-code
Oct 23, 2025
Merged

Add assert_unsuccessful_code function#506
Chemaclass merged 1 commit into
mainfrom
feat/505-new-assert-unsuccessful-code

Conversation

@Chemaclass
Copy link
Copy Markdown
Member

@Chemaclass Chemaclass commented Oct 23, 2025

📚 Description

Closes: #505 by @jrfnl

Add assert_unsuccessful_code assertion function to verify that a command or function exits with a non-zero exit code. This complements the existing assert_successful_code function, providing a semantic way to assert failures without needing to specify an exact exit code.

🔖 Changes

  • Add assert_unsuccessful_code function
    • Asserts that the exit code is non-zero (any value other than 0)
    • Follows the same pattern as assert_successful_code
    • Accepts optional callable parameter, defaults to $? if not provided
  • Add tests and documentation for it

✅ To-do list

  • I updated the CHANGELOG.md to reflect the new feature or fix
  • I updated the documentation to reflect the changes

@Chemaclass Chemaclass self-assigned this Oct 23, 2025
@Chemaclass Chemaclass added the enhancement New feature or request label Oct 23, 2025
@Chemaclass Chemaclass enabled auto-merge October 23, 2025 20:25
@Chemaclass Chemaclass merged commit 58a30d2 into main Oct 23, 2025
18 checks passed
@Chemaclass Chemaclass deleted the feat/505-new-assert-unsuccessful-code branch October 23, 2025 20:33
@jrfnl
Copy link
Copy Markdown

jrfnl commented Oct 23, 2025

Awesome! Thank you @Chemaclass !

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.

[FR] New assert_unsuccessful_code assertion

3 participants