如何从Serverspec中的输出中省略powershell行?

时间:2016-08-12 12:53:54

标签: rspec serverspec

我在windows机器上运行serverspec,我正在以html格式创建输出。

rspec 'C:\Ruby Scripts\Test.rb' --format html --out 'C:\Ruby Scripts\Test.html'

但是如果测试用例失败,输出html中包含很多powershell函数列表。如何省略powershell函数并获得摘要?

脚本如下。

require 'spec_helper'
set :backend, :cmd
set :os, :family => 'windows'


# check the msi is installed or not
describe package('Orca') do
  it { should be_installed }
end

#
describe windows_registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyProductName') do
  it { should exist }
end

describe windows_registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyProductName') do
  it { should have_property('AppServer') }
end

describe windows_registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyProductName') do
  it { should have_property('DBServer') }
end

describe windows_registry_key('HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyProductName') do
  it { should have_property('WebServer') }
end

结果是具有Powershell功能,如下图所示。如何从结果html中省略这个Powershell函数。 enter image description here

0 个答案:

没有答案