如何从 rspec 测试用例写入 Rspec 输出日志文件?

How to write into Rspec output log file from rspec test case?

我有 Rspec 个测试用例,但我想将变量中的一些数据写入 Rspec 输出文件以供进一步处理,那么如何写入 --out rspec_results.html[= 生成的输出文件13=]

在您的 spec_helper.rb 文件中记下这段代码

RSpec.configure do |config|
  config.example_status_persistence_file_path = 'spec/examples.txt'
end