我们正在尝试在windows中使用ServerSpec验证应用程序安装。我已经在ruby文件中编写了以下代码行(使用Test.rb)
require 'spec_helper'
set :backend, :cmd
set :os, :family => 'windows'
describe package('ApplicationCorePackage') do
it { should be_installed }
end我像这样运行脚本。
rspec 'C:\Ruby Scripts\Test.rb' --format html --out 'C:\Ruby Scripts\Test.html'它正在正确检查这一点。但是我想检查一下msi(windows installer软件包)的特定版本。如何在serverspec中做到这一点?
发布于 2016-08-13 03:34:12
有关文档,请访问:http://serverspec.org/resource_types.html#package
匹配器be_installed接受链with_version。因此,对于RSpec 3语法,我们有:
describe package('ApplicationCorePackage') do
it { expect(subject).to be_installed.with_version('version') }
end如果您的问题是是否需要MSI提供者的by链,那么答案是不需要。
https://stackoverflow.com/questions/38897534
复制相似问题