0

我正在使用以下红宝石脚本

describe command('curl -s -k - i %{http_code} https://localhost/xx/xxx') do
  its(:stdout) { should match /200/ }
end

但我不确定这个脚本是否有效。如何确保此脚本有效?

4

2 回答 2

1

通常,Serverspec 通过 Test Kitchen 集成测试框架与 Chef 一起使用(尽管这些天 InSpec 更受欢迎)。您使用该kitchen verify命令运行测试。

于 2018-09-04T20:51:05.477 回答
0

在我看来,您想要的是:

describe command('curl -s -k -I https://localhost/xx/xxx') do
  its(:stdout) { should match /200/ }
end
于 2019-02-17T06:35:49.233 回答