Merge pull request #1111 from Anirudh-Gupta/master

fixes debian package manager and some of the code examples
This commit is contained in:
Christoph Hartmann 2016-09-21 10:41:26 +02:00 committed by GitHub
commit 28dcf11a14
4 changed files with 6 additions and 2 deletions

View file

@ -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
" "

View file

@ -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
" "

View file

@ -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

View file

@ -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',
} }