modification in command resource example

This commit is contained in:
Anirudh Gupta 2016-05-16 11:53:21 +05:30
parent 7c9706bbd7
commit c9dbbfd5dc

View file

@ -10,11 +10,15 @@ module Inspec::Resources
desc 'Use the command InSpec audit resource to test an arbitrary command that is run on the system.' desc 'Use the command InSpec audit resource to test an arbitrary command that is run on the system.'
example " example "
describe command('ls -al /') do describe command('ls -al /') do
it { should exist }
its('stdout') { should match /bin/ } its('stdout') { should match /bin/ }
its('stderr') { should eq '' } its('stderr') { should eq '' }
its('exit_status') { should eq 0 } its('exit_status') { should eq 0 }
end end
command('ls -al /').exist? will return false. Existence of command should be checked this way.
describe command('ls') do
it { should exist }
end
" "
attr_reader :command attr_reader :command