Skip to content

Commit

Permalink
#314: testcase rule, support underline in TC/AR/ER
Browse files Browse the repository at this point in the history
Fixed #314
  • Loading branch information
dgroup committed Jan 26, 2021
1 parent d4889f5 commit 0ed9173
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/lazylead/task/accuracy/testcase.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def passed(issue)
return false if issue.description.nil?
@tc = @ar = @er = -1
issue.description.split("\n").reject(&:blank?).each_with_index do |l, i|
line = escape l.downcase.gsub(/(\s+|\*)/, "")
line = escape l.downcase.gsub(/(\s+|\*|\+)/, "")
detect_tc line, i
detect_ar line, i
detect_er line, i
Expand Down Expand Up @@ -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: tc testcases]
%w[testcase: tc: teststeps: teststeps steps: tcsteps: tc testcases steps]
end

# Detect index of line with actual result
Expand Down
9 changes: 9 additions & 0 deletions test/lazylead/task/accuracy/testcase_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,15 @@ class TestcaseTest < Lazylead::Test
*{color:#DE10AA}[AR]{color}* = YYYY"
end

test "TC with underline" do
assert testcase? "{color:#0747a6}+*Test Steps:*+{color}
# 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))
Expand Down

0 comments on commit 0ed9173

Please sign in to comment.