如何覆盖serverspec
的日志格式并在单独的文件中提取?
我能够做到这一点,但无法在单独的文件中提取。
我的代码段是:
RSpec.configure do |c|
c.output_stream = File.open('serverspec-result.json', 'w')
end
当我正在运行kitchen test
时,它会给我以下警告:
RSpec's reporter has already been initialized with
#<IO:<STDOUT>> as the output stream,
so your change to `output_stream` will be ignored.
You should configure it earlier for it to take effect.