私はInSpecでテストを作成しています。それは私のApacheのテストです:InSpecでコンテキストを作成するにはどうすればよいですか?
require 'inspec'
if os[:family] == 'redhat'
describe package 'httpd' do
it { should be_installed }
end
describe service 'httpd' do
it { should be_enabled }
it { should be_running }
end
describe file '/etc/httpd/conf/httpd.conf' do
it { should be_file }
end
end
describe port(80) do
it { should_not be_listening }
end
describe port(9000) do
it { should be_listening }
end
私の質問は文脈に関連しています。 InSpecの前に私はChefSpecを使いました。私はコンテキストを作成する方法が好きで、出力はコンテキストを示しています。出力上記の例では、これです:
System Package
✔ httpd should be installed
Service httpd
✔ should be enabled
✔ should be running
File /etc/httpd/conf/httpd.conf
✔ should be file
Port 80
✔ should not be listening
Port 9000
✔ should be listening
私が知っていると私のテストのために、より明確な出力を得るために出力の家族の味やバージョンやアーチを含めるように好きになるでしょう。
提案がありますか?
私はあなたが 'control'を探していると思います[ドキュメント](http://inspec.io/docs/reference/dsl_inspec/)を参照してください。 – Tensibai