Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Addressing issue #149 (#150)
Browse files Browse the repository at this point in the history
Moved the 'linux_update' resource reference out of the describe/subject
block into a control-level variable. Also, generated a list of package
names to pass to the 'List of out-of-date packages' block instead of
the entire JSON object for cleaner output.

Signed-off-by: Lesley Kimmel <[email protected]>

Co-authored-by: Lesley Kimmel <[email protected]>
Co-authored-by: Trevor Vaughan <[email protected]>
  • Loading branch information
3 people authored Mar 30, 2020
1 parent 17d42b7 commit 370ba60
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions controls/V-71999.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,17 @@
Vulnerability Management (IAVM) process, this is a finding."
desc "fix", "Install the operating system patches or updated packages
available from Red Hat within 30 days or sooner as local policy dictates."

updates = linux_update.updates
package_names = updates.map { |h| h['name'] }

describe.one do
describe 'List of out-of-date packages' do
subject { linux_update.updates }
subject { package_names }
it { should be_empty }
end

linux_update.updates.each do |update|
updates.each do |update|
describe package(update['name']) do
its('version') { should eq update['version'] }
end
Expand Down

0 comments on commit 370ba60

Please sign in to comment.