Puppet 木偶规范和测试厨房

Puppet 木偶规范和测试厨房,puppet,serverspec,Puppet,Serverspec,如何覆盖serverspec的日志格式并在单独的文件中提取? 我能够做到这一点,但不能提取在单独的文件 我的代码片段是: RSpec.configure do |c| c.output_stream = File.open('serverspec-result.json', 'w') end 当我运行厨房测试时,它会给我以下警告: RSpec's reporter has already been initialized with #<IO:<STDOUT>> a

如何覆盖serverspec的日志格式并在单独的文件中提取? 我能够做到这一点,但不能提取在单独的文件

我的代码片段是:

RSpec.configure do |c|
  c.output_stream = File.open('serverspec-result.json', 'w')
end
当我运行厨房测试时,它会给我以下警告:

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.