Serverspec timestampの確認サンプル

環境
Serverspec
RedHat 8.6

書式
it { should <条件> }
its(<対象>) { should <条件> <値> }
「テスト条件」は対象とするリソースの状態を指定するもので、次のような書式で記述する。

操作例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
describe command("date") do
its(:stdout) { should match /JST/ }
end
describe command("date") do its(:stdout) { should match /JST/ } end
describe command("date") do
 its(:stdout) { should match /JST/ }
end

 

Ansible

Posted by arkgame