0

我在 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 函数。 在此处输入图像描述

4

0 回答 0