Skip to content

Commit 8b286e9

Browse files
committed
docs: fix test name rendering
1 parent 4693dcf commit 8b286e9

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

docs/templates/requirements-traceability-matrix.md.j2

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ toc-own-page: true
2222
{{ text | replace('Rule: ', '') | replace('Feature: ', '') }}
2323
{%- endmacro -%}
2424

25+
{%- macro strip_bats_syntax(text) -%}
26+
{{ text | replace('@test "', '') | replace('" \{', '') | replace('" {', '') }}
27+
{%- endmacro -%}
28+
2529
{%- macro display_short(text) -%}
2630
{{ text[:60] }}
2731
{%- endmacro %}
@@ -77,8 +81,8 @@ The authoritative source of change history is the [Git log](https://github.com/p
7781

7882
{%- if ns_tests.test_list -%}
7983
{%- for test_id in ns_tests.test_list %}
80-
{%- set test_name = strip_gherkin_prefix(sbdl[test_id]['custom:title']) | trim %}
81-
| {{ display_short(req_name) }} | {{ display_short(test_name) }} | Traced |
84+
{%- set test_name = strip_bats_syntax(strip_gherkin_prefix(sbdl[test_id]['custom:title'])) | trim %}
85+
| {{ display_short(req_name) }} | {{ test_id }}: {{ display_short(test_name) | title }} | Traced |
8286
{%- endfor -%}
8387
{%- else %}
8488
| {{ display_short(req_name) }} | — | **Not covered** |

docs/templates/software-test-plan.md.j2

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ toc-own-page: true
2222
{{ text | replace('Rule: ', '') | replace('Feature: ', '') }}
2323
{%- endmacro %}
2424

25+
{%- macro strip_bats_syntax(text) -%}
26+
{{ text | replace('@test "', '') | replace('" \{', '') | replace('" {', '') }}
27+
{%- endmacro -%}
28+
2529
# Introduction
2630

2731
## Purpose
@@ -108,7 +112,7 @@ BATS tests verify tool presence, version alignment, and end-to-end workflows (co
108112
{%- if 'requirement' in test_elem -%}
109113
{%- for test_req_ref in test_elem.requirement if test_req_ref.identifier == req_ref.identifier -%}
110114
{%- set ns_tests.has_tests = true %}
111-
- {{ reencode(strip_gherkin_prefix(test_elem['custom:title'])) }}
115+
- **{{ test_id }}**: {{ reencode(strip_bats_syntax(test_elem['custom:title'])) | title }}
112116
{%- endfor -%}
113117
{%- endif -%}
114118
{%- endif -%}

0 commit comments

Comments
 (0)