From 5a9a901230cdd567c73e43ac114a84465b2c875c Mon Sep 17 00:00:00 2001 From: Robert Clark Date: Fri, 23 Apr 2021 11:29:23 -0400 Subject: [PATCH] Cleanup Ident test to use hash instead of array --- test/unit/inspec_tools/happymapper_test.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/unit/inspec_tools/happymapper_test.rb b/test/unit/inspec_tools/happymapper_test.rb index a65584c..3789b28 100644 --- a/test/unit/inspec_tools/happymapper_test.rb +++ b/test/unit/inspec_tools/happymapper_test.rb @@ -3,19 +3,19 @@ describe "HappyMapperTools::Benchmark::Ident correctly determines the system for each identifier" do # test values (tv); tv[0] == identifier, tv[1] == system - tvList = [ - ['CCI-000213', 'http://cyber.mil/cci'], - ['V-72859', 'http://cyber.mil/legacy'], - ['SV-87511', 'http://cyber.mil/legacy'], - ['CCI-00213', 'https://public.cyber.mil/stigs/cci/'], - ['CCI-0000213', 'https://public.cyber.mil/stigs/cci/'], - ] + tvList = { + 'CCI-000213' => 'http://cyber.mil/cci', + 'V-72859' => 'http://cyber.mil/legacy', + 'SV-87511' => 'http://cyber.mil/legacy', + 'CCI-00213' => 'https://public.cyber.mil/stigs/cci/', + 'CCI-0000213' => 'https://public.cyber.mil/stigs/cci/', + } - tvList.each do |tv| - it tv[0] do + tvList.each do |identifier, system| + it identifier do # Ident.new automatically determines ident.system - ident = HappyMapperTools::Benchmark::Ident.new tv[0] - assert_equal(tv[1], ident.system) + ident = HappyMapperTools::Benchmark::Ident.new identifier + assert_equal(system, ident.system) end end end