Distinguishing failed specs from failing to run the specs

Hi all,

is it possible to find out if rspec failed to run the specs? I would
like to add a notification to guard-rspec (an autospec replacement) that
tells me something along the lines of “I could not run the specs because
of a SyntaxError” in addition to the normal Passed/Pending/Failed
notification.

guard-rspec uses Kernel#system to run rspec. I tried looking at the exit
code, but that does not distinguish between failed specs and failing to
run the specs. This would also not tell me the reason for the failure
(although that is secondary to knowing there was a problem running the
specs).

Parsing rspec’s output is difficult, and I would prefer not having to
do that. Another option would be to set a flag in a formatter (“rspec
hasn’t started to run the specs, so if $? == 1, it’s not because of a
failing spec”), but that is a fairly ugly kludge.

Any other ideas on how to do this?

Thanks,
Johannes Holzfuß