Is there a way to programmatically count RSpec tests?
Given a Rakefile that executes some RSpec tests by way of a Spec::开发者_如何学运维Rake::SpecTask
, how can I programmatically determine the number of tests that passed, failed, and are pending once the task that ran the tests is finished?
SpecTask is just a nice wrapper around sh ruby -S spec ...
, so you have no access to the formatter's meta data. You could parse the result, or do the evaluation somewhere else than your Rakefile, or not use SpecTask at all.
精彩评论