-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not match expectations outside specs #13079
Do not match expectations outside specs #13079
Conversation
There's probably some value in making this permanent, maybe with a flag. |
|
||
Signal::CHLD.trap do | ||
child_process = chan.receive | ||
Process.exists?(child_process.pid).should be_false | ||
existed.send(Process.exists?(child_process.pid)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An assertion failure here is an unhandled exception for a signal handler, which would have been a fatal runtime error, so this spec requires some non-trivial editing.
{% end %} | ||
|
||
raise "BUG: failed to compile dynamic library" unless $?.success? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is special because this helper is used inside both it
s and before_all
s, and assertion failures in the latter are not caught. In any case, since the backtick always returns a String
, the original should be_truthy
never raises, so it was incorrect in the first place.
Some calls of
#should
are done outside spec examples (more specifically, anit
orbefore_each
), which means if the expectation does not match, theSpec::AssertionFailed
exception is not handled and will stop any subsequent specs from being added and run. This PR fixes those occurrences.They are detected by monkeypatching
Spec
: