How to get access to results after suite is run

16 views
Skip to first unread message

tcb...@gmail.com

unread,
May 6, 2019, 10:10:24 AM5/6/19
to rspec
I would like to get access to the tests results after the suite is run, something like:

RSpec.configure do |config|

  config.after(:suite) do
failures = RSpec::ExecutionResults.failures

  end
end



Jon Rowe

unread,
May 13, 2019, 5:46:48 AM5/13/19
to rs...@googlegroups.com
Hi 

The official way to do this is to build a formatter / listener and subscribe to the relevant notification (either gathering failures as they happen or all of them at the end).

There is a way to get all examples via `RSpec.world` but that is currently considered a private API and thus usage is at your own risk :)

Cheers
Jon Rowe
---------------------------
Reply all
Reply to author
Forward
0 new messages