File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ Feature : Creating BOM using Json format
2+
3+ Scenario : Running against simple fixture
4+ Given I use a fixture named "simple"
5+ And I run `cyclonedx-ruby --path . --format json`
6+ Then the output should contain:
7+ """
8+ 5 gems were written to BOM located at ./bom.json
9+ """
10+ And a file named "bom.json" should exist
11+ And the generated XML Json file "bom.json" matches "bom.json.expected"
Original file line number Diff line number Diff line change 1+ Then ( 'the generated XML Json file {string} matches {string}' ) do |generated_file , expected_file |
2+ generated_file_contents = File . read ( expand_path ( generated_file ) )
3+ expected_file_contents = File . read ( expand_path ( expected_file ) )
4+
5+ # "serialNumber": "urn:uuid:d498cdc2-5494-4031-b37d-ff3d10d336bf"
6+ serial_number_matcher = /\" serialNumber\" : \" urn:uuid:[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\" /
7+ normalized_serial_number = '"serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000"'
8+ normalized_generated_file_contents = generated_file_contents . gsub ( serial_number_matcher , normalized_serial_number )
9+ normalized_expected_file_contents = expected_file_contents . gsub ( serial_number_matcher , normalized_serial_number )
10+
11+ expect ( normalized_expected_file_contents ) . to eq ( normalized_generated_file_contents )
12+ end
You can’t perform that action at this time.
0 commit comments