From 02c6ac89629d96a4041d67060fc43eba8b2788db Mon Sep 17 00:00:00 2001 From: Yurii Dubinka Date: Mon, 25 Jan 2021 20:01:55 +0300 Subject: [PATCH] #312: add support of "TC", "Test cases" keywords Fixed #312 --- lib/lazylead/task/accuracy/testcase.rb | 2 +- test/lazylead/task/accuracy/testcase_test.rb | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/lazylead/task/accuracy/testcase.rb b/lib/lazylead/task/accuracy/testcase.rb index ce9ec03..b298b79 100644 --- a/lib/lazylead/task/accuracy/testcase.rb +++ b/lib/lazylead/task/accuracy/testcase.rb @@ -66,7 +66,7 @@ def with_tc_ar_er? def detect_tc(line, index) return unless @tc.negative? @tc = index if eql? line, - %w[testcase: tc: teststeps: teststeps steps: tcsteps:] + %w[testcase: tc: teststeps: teststeps steps: tcsteps: tc testcases] end # Detect index of line with actual result diff --git a/test/lazylead/task/accuracy/testcase_test.rb b/test/lazylead/task/accuracy/testcase_test.rb index bcc97aa..7a56d85 100644 --- a/test/lazylead/task/accuracy/testcase_test.rb +++ b/test/lazylead/task/accuracy/testcase_test.rb @@ -246,6 +246,24 @@ class TestcaseTest < Lazylead::Test *{color:#DE10AA}[AR]{color}* = YYYY" end + test "tc" do + assert testcase? "*TC* + # Step 1 + # Step .. + # Step N + *{color:#00673A}[ER]{color}* = XXXX + *{color:#DE10AA}[AR]{color}* = YYYY" + end + + test "testcases" do + assert testcase? "*Test cases* + # Step 1 + # Step .. + # Step N + *{color:#00673A}[ER]{color}* = XXXX + *{color:#DE10AA}[AR]{color}* = YYYY" + end + # ensure that issue description has a test case, AR and ER def testcase?(desc) Testcase.new.passed(OpenStruct.new(description: desc))