Chef:在 inspec 命令测试中使用 kitchen 输入值

Chef: use kitchen input value in inspec command test

我正尝试在 Inspec 测试中使用来自 .kitchen.yml 的输入值,如下所示:

/.kitchen.yml

- inputs:
  my_service: some_service_name

/tests/my_test.rb

describe command('/bin/some_app status (input('my_service'))')
  its('stdout') { should include 'foo' }
end

不幸的是,当我尝试 kitchen verify 套件时遇到语法错误。 目标是测试 /bin/some_app status my_service 的输出是否包含 foo.

找到语法问题的解决方案。正确语法:

describe command("/bin/some_app status " + input("my_service"))
  its('stdout') { should include 'foo' }
end