Skip to content

Commit

Permalink
fixing rubocop errors
Browse files Browse the repository at this point in the history
Signed-off-by: Will Dower <[email protected]>
  • Loading branch information
wdower authored and Kyle Fagan committed May 13, 2021
1 parent f2191b4 commit 22d7314
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ tmp
profile/
lib/data/cis_to_nist_mapping
lib/data/cis_to_nist_critical_controls
vendor/*
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,5 @@ Layout/InitialIndentation:
Enabled: true
Layout/LeadingCommentSpace:
Enabled: true
Metrics/AbcSize:
Enabled: false
12 changes: 6 additions & 6 deletions test/unit/inspec_tools/xccdf_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def test_xccdf_init_with_invalid_params

def test_xccdf_attributes
xccdf = InspecTools::XCCDF.new(File.read('examples/xccdf2inspec/data/U_RHEL_7_STIG_V3R3_Manual-xccdf.xml'), true)
assert_equal(xccdf.publisher, "DISA")
assert_equal(xccdf.published, "2021-03-01")
assert_equal('DISA', xccdf.publisher)
assert_equal('2021-03-01', xccdf.published)
end

def test_to_inspec
Expand Down Expand Up @@ -49,13 +49,13 @@ def test_controls_count

def test_vuln_id_as_control_id
xccdf = InspecTools::XCCDF.new(File.read('examples/xccdf2inspec/data/U_RHEL_7_STIG_V3R3_Manual-xccdf.xml'), true)
vulnID_inspec_json = xccdf.to_inspec
assert(vulnID_inspec_json['controls'].first['id'].start_with? 'V-')
vuln_id_inspec_json = xccdf.to_inspec
assert(vuln_id_inspec_json['controls'].first['id'].start_with?('V-'))
end

def test_rule_id_as_control_id
xccdf = InspecTools::XCCDF.new(File.read('examples/xccdf2inspec/data/U_RHEL_7_STIG_V3R3_Manual-xccdf.xml'), false)
ruleID_inspec_json = xccdf.to_inspec
assert(ruleID_inspec_json['controls'].first['id'].start_with? 'SV-')
rule_id_inspec_json = xccdf.to_inspec
assert(rule_id_inspec_json['controls'].first['id'].start_with?('SV-'))
end
end

0 comments on commit 22d7314

Please sign in to comment.