Отвечая на мой собственный вопрос. Я могу опубликовать более подробный ответ, если кому-то интересно.
Суть этого в том, чтобы оценивать тестовые файлы, а затем получать контекст из оцененного теста:
Riot.alone! # so Riot doesn't automatically run the tests
["/path/to/test/file"].each do |test_file|
eval(IO.read(path), binding, test_file) # load test file
Riot.root_contexts.each do |context|
reporter = MyReporter.new
context.run reporter
# do something cool with reporter results
end
Riot.root_contexts.clear # clean out root_contexts so it's clean for the next run
end
Где MyReporter - ваша реализация, которая обрабатывает результаты теста на прохождение / неудачу. Смотри https://github.com/thumblemonks/riot/blob/master/lib/riot/reporter.rb