Skip to content

Commit 2e83540

Browse files
committed
implement missing step for current feature
also refactor step definitions a little bit
1 parent c456b07 commit 2e83540

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

behave/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
add_test(NAME behave_stable_tests COMMAND behave -t ~skip -t ~wip
1+
add_test(NAME behave_stable_tests COMMAND behave -t ~skip -t ~wip -k
22
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
33
)
44

5-
add_test(NAME behave_wip_tests COMMAND behave -w
5+
add_test(NAME behave_wip_tests COMMAND behave -t wip -k --no-capture --no-logcapture
66
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
77
)

behave/issue_list_create.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Feature: Creating and listing issues
3333
| thi-iss-yyy-zzz | Third issue | open |
3434
And it prints "total: 3 issues"
3535

36-
@skip
36+
@wip
3737
Scenario: creation of identical issues is rejected
3838
Given an empty issue repository
3939
When we create an issue titled "A unique issue" with description
@@ -49,7 +49,7 @@ Feature: Creating and listing issues
4949
Then it prints "Issue already exists: a-uni-iss-zzz-[hash]"
5050
And terminates with exit code ERROR
5151

52-
@skip
52+
@wip
5353
Scenario: creation of issues with identical title but different description is allowed
5454
Given an empty issue repository
5555
When we create an issue titled "A unique issue" with description

behave/steps/fix_cli.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ def start_fix_no_args(context):
2020
_start_fix_with_args(context, [])
2121

2222

23+
def check_output_regex(context, pattern):
24+
context.fix.expect(pattern)
25+
26+
2327
@then(u'it prints "{output}"')
2428
def check_output(context, output):
2529
pattern = output.replace("[hash]", "[0-9a-f]{7}")
2630
if pattern != output:
27-
context.fix.expect(pattern)
31+
check_output_regex(context, pattern)
2832
else:
2933
context.fix.expect_exact(output)
3034

behave/steps/fix_issues.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ def create_issue_random_description(context, title):
3232
def check_issue_list(context):
3333
# first: column headings, separated by non-word characters,
3434
# then: entries for each column, again separated by non-word characters
35-
context.fix.expect(r'ID\W+STATUS\W+TITLE') # TODO: call fix_cli
35+
fix_cli.check_output_regex(context, r'ID\W+STATUS\W+TITLE')
3636
for row in context.table:
3737
fix_cli.check_output(context, fr'{row["issue ID prefix"]}-[hash]\W+{row["status"]}\W+"{row["title"]}"')
38+
39+
40+
@then(u'it prints a list of {count:d} issues')
41+
def check_issue_list_count(context, count):
42+
check_issue_list(context)
43+
fix_cli.check_output(f"total: {count} issues")

0 commit comments

Comments
 (0)