mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +00:00
Merge pull request #1111 from Anirudh-Gupta/master
fixes debian package manager and some of the code examples
This commit is contained in:
commit
28dcf11a14
4 changed files with 6 additions and 2 deletions
|
@ -9,6 +9,7 @@ module Inspec::Resources
|
||||||
example "
|
example "
|
||||||
describe gem('rubocop') do
|
describe gem('rubocop') do
|
||||||
it { should be_installed }
|
it { should be_installed }
|
||||||
|
its('version') { should eq '0.33.0' }
|
||||||
end
|
end
|
||||||
"
|
"
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ module Inspec::Resources
|
||||||
example "
|
example "
|
||||||
describe oneget('zoomit') do
|
describe oneget('zoomit') do
|
||||||
it { should be_installed }
|
it { should be_installed }
|
||||||
|
its('version') { should eq '1.2.3' }
|
||||||
end
|
end
|
||||||
"
|
"
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ module Inspec::Resources
|
||||||
name 'os'
|
name 'os'
|
||||||
desc 'Use the os InSpec audit resource to test the platform on which the system is running.'
|
desc 'Use the os InSpec audit resource to test the platform on which the system is running.'
|
||||||
example "
|
example "
|
||||||
describe os.family do
|
describe os[:family] do
|
||||||
it { should eq 'redhat' }
|
it { should eq 'redhat' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -91,9 +91,11 @@ module Inspec::Resources
|
||||||
assignment_re: /^\s*([^:]*?)\s*:\s*(.*?)\s*$/,
|
assignment_re: /^\s*([^:]*?)\s*:\s*(.*?)\s*$/,
|
||||||
multiple_values: false,
|
multiple_values: false,
|
||||||
).params
|
).params
|
||||||
|
# If the package is removed and not purged, Status is "deinstall ok config-files" with exit_status 0
|
||||||
|
# If the package is purged cmd fails with non-zero exit status
|
||||||
{
|
{
|
||||||
name: params['Package'],
|
name: params['Package'],
|
||||||
installed: true,
|
installed: params['Status'].split(' ').first == 'install',
|
||||||
version: params['Version'],
|
version: params['Version'],
|
||||||
type: 'deb',
|
type: 'deb',
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue