File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33require 'test_helper'
44
55class ProfilesTest < Minitest ::Test
6- def test_result
7- OpenStruct . new ( id : [ 'xccdf_org.ssgproject.content_profile_standard' ] )
8- end
6+ describe 'profiles are parsed from' do
7+ include OpenscapParser :: Profiles
8+ include OpenscapParser :: XMLReport
99
10- def report_description
11- 'description'
12- end
10+ def report_description
11+ 'description'
12+ end
1313
14- include OpenscapParser ::Profiles
15- include OpenscapParser ::XMLReport
14+ def setup
15+ @profiles = nil
16+ end
1617
17- def setup
18- report_xml ( file_fixture ( 'xccdf_report.xml' ) . read )
19- end
18+ test 'standard fedora' do
19+ def test_result_node
20+ OpenStruct . new ( id : [ 'xccdf_org.ssgproject.content_profile_standard' ] )
21+ end
22+
23+ report_xml ( file_fixture ( 'xccdf_report.xml' ) . read )
24+
25+ expected = {
26+ 'xccdf_org.ssgproject.content_profile_standard' => \
27+ 'Standard System Security Profile for Fedora'
28+ }
29+ assert_equal expected , profiles
30+ end
31+
32+ test 'ospp42 rhel' do
33+ def test_result_node
34+ OpenStruct . new ( id : [ 'xccdf_org.open-scap_testresult_xccdf_org.' \
35+ 'ssgproject.content_profile_ospp42' ] )
36+ end
37+
38+ report_xml ( file_fixture ( 'rhel-xccdf-report.xml' ) . read )
2039
21- test 'profiles' do
22- expected = {
23- 'xccdf_org.ssgproject.content_profile_standard' => \
24- 'Standard System Security Profile for Fedora'
25- }
26- assert_equal expected , profiles
40+ expected = {
41+ 'xccdf_org.ssgproject.content_profile_ospp42' => 'OSPP - Protection ' \
42+ 'Profile for General Purpose Operating Systems v. 4.2'
43+ }
44+ assert_equal expected , profiles
45+ end
2746 end
2847end
You can’t perform that action at this time.
0 commit comments