[rb] allow pending test guards to require matching provided exception - #17859
Conversation
|
Thank you, @titusfortner for this code suggestion. The support packages contain example code that many users find helpful, but they do not necessarily represent After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks. |
PR Summary by QodoException-aware
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
1.
|
|
Code review by qodo was updated up to the latest commit a6cbf1b |
💥 What does this PR do?
Lets a Ruby test guard require a specific failure: a guarded example is marked pending only when it fails for the expected reason. If it fails a different way, still passes, or times out, it fails as usual — so a pending guard can no longer silently hide a genuinely broken path or a bad test payload.
exception:takes{class:, message:};message:is optional and follows RSpec'sraise_errorsemantics (Regexp as pattern, String as exact match).When the example fails for the wrong reason, the original failure is preserved and annotated with what was expected:
🔧 Implementation Notes
aroundhook; plain pending, eager skip, andSKIP_PENDINGbehave as before.Guard#initializenow dups the guarded hash before defaulting:reason, fixing a pre-existingFrozenErroron frozen/shared guard constants.🤖 AI assistance
aroundhook, unit tests, and docs💡 Additional Considerations
🔄 Types of changes