mirror of
https://github.com/inspec/inspec
synced 2024-11-13 08:27:08 +00:00
modification in command resource example
This commit is contained in:
parent
7c9706bbd7
commit
c9dbbfd5dc
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue