Skip to content

Commit

Permalink
Cleanup Ident test to use hash instead of array
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Clark committed Apr 23, 2021
1 parent 082802f commit 5a9a901
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/unit/inspec_tools/happymapper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5a9a901

Please sign in to comment.