From 22d73140d97549e861745b706ded22afe042c818 Mon Sep 17 00:00:00 2001 From: Will Dower Date: Tue, 11 May 2021 13:23:09 -0400 Subject: [PATCH] fixing rubocop errors Signed-off-by: Will Dower --- .gitignore | 1 + .rubocop.yml | 2 ++ test/unit/inspec_tools/xccdf_test.rb | 12 ++++++------ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 9bf1d6df..d19c35a7 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ tmp profile/ lib/data/cis_to_nist_mapping lib/data/cis_to_nist_critical_controls +vendor/* diff --git a/.rubocop.yml b/.rubocop.yml index 55913a22..0ed33749 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -195,3 +195,5 @@ Layout/InitialIndentation: Enabled: true Layout/LeadingCommentSpace: Enabled: true +Metrics/AbcSize: + Enabled: false diff --git a/test/unit/inspec_tools/xccdf_test.rb b/test/unit/inspec_tools/xccdf_test.rb index 7cff1e51..0f25adbe 100644 --- a/test/unit/inspec_tools/xccdf_test.rb +++ b/test/unit/inspec_tools/xccdf_test.rb @@ -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 @@ -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