开发者

Is there a way to programmatically count RSpec tests?

开发者 https://www.devze.com 2023-01-01 17:57 出处:网络
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 th

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号