-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- added fallback logic for unrecognized idents, using legacy behaviors - added unit testing for the new Ident constructor * Cleanup Ident test to use hash instead of array Signed-off-by: Jarod Neuner <[email protected]> Signed-off-by: Robert Clark <[email protected]> Co-authored-by: Robert Clark <[email protected]>
- Loading branch information
Showing
2 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'minitest/spec' | ||
require 'minitest/autorun' | ||
|
||
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.each do |identifier, system| | ||
it identifier do | ||
# Ident.new automatically determines ident.system | ||
ident = HappyMapperTools::Benchmark::Ident.new identifier | ||
assert_equal(system, ident.system) | ||
end | ||
end | ||
end |