lazylead 0.9.1 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/Rakefile +1 -2
- data/lazylead.gemspec +13 -13
- data/lib/lazylead/confluence.rb +1 -2
- data/lib/lazylead/os.rb +55 -0
- data/lib/lazylead/task/accuracy/accuracy.rb +2 -3
- data/lib/lazylead/task/accuracy/attachment.rb +1 -0
- data/lib/lazylead/task/accuracy/environment.rb +3 -8
- data/lib/lazylead/task/accuracy/logs_link.rb +52 -0
- data/lib/lazylead/task/accuracy/records.rb +1 -1
- data/lib/lazylead/task/accuracy/required.rb +43 -0
- data/lib/lazylead/task/accuracy/screenshots.rb +2 -3
- data/lib/lazylead/task/accuracy/servers.rb +7 -7
- data/lib/lazylead/task/accuracy/testcase.rb +27 -20
- data/lib/lazylead/task/fix_version.rb +5 -8
- data/lib/lazylead/task/loading.rb +3 -2
- data/lib/lazylead/task/micromanager.rb +27 -3
- data/lib/lazylead/task/svn/diff.rb +9 -9
- data/lib/lazylead/task/svn/grep.rb +8 -71
- data/lib/lazylead/task/svn/svn.rb +107 -0
- data/lib/lazylead/task/svn/touch.rb +5 -7
- data/lib/lazylead/version.rb +1 -1
- data/lib/messages/illegal_assignee_change.erb +1 -2
- data/lib/messages/illegal_duedate_change.erb +5 -3
- data/lib/messages/loading.erb +2 -2
- data/lib/messages/svn_diff.erb +29 -29
- data/lib/messages/svn_diff_attachment.erb +5 -7
- data/lib/messages/svn_grep.erb +34 -32
- data/readme.md +8 -5
- data/test/lazylead/system/jira_test.rb +8 -0
- data/test/lazylead/task/accuracy/accuracy_test.rb +1 -1
- data/test/lazylead/task/accuracy/logs_link_test.rb +50 -0
- data/test/lazylead/task/accuracy/onlyll_test.rb +1 -1
- data/test/lazylead/task/accuracy/screenshots_test.rb +2 -4
- data/test/lazylead/task/accuracy/testcase_test.rb +34 -0
- data/test/lazylead/task/alert/alertif_test.rb +2 -1
- data/test/lazylead/task/assignment_test.rb +2 -1
- data/test/lazylead/task/created_recently_test.rb +2 -1
- data/test/lazylead/task/duedate_test.rb +2 -2
- data/test/lazylead/task/fix_version_test.rb +2 -1
- data/test/lazylead/task/loading_test.rb +6 -2
- data/test/lazylead/task/micromanager_test.rb +8 -1
- data/test/lazylead/task/missing_comment_test.rb +1 -1
- data/test/lazylead/task/svn/diff_test.rb +1 -1
- data/test/lazylead/task/svn/grep_test.rb +2 -1
- data/test/test.rb +4 -3
- metadata +31 -25
@@ -91,18 +91,16 @@
|
|
91
91
|
<p>Commit(s) since <code><%= since_rev %></code> revision in <a href="<%= svn_url %>"><%= svn_url %></a>:</p>
|
92
92
|
<div id="table-of-contents" class="table-of-contents">
|
93
93
|
<ul>
|
94
|
-
<%
|
95
|
-
|
96
|
-
<li><a href="#<%= details[0] %>"><%= details[0] %></a> by <%= details[1] %> at <%= details[2] %></li>
|
94
|
+
<% commits.each do |commit| %>
|
95
|
+
<li><a href="#<%= commit.rev %>"><%= commit.rev %></a> by <%= commit.author %> at <%= commit.time %></li>
|
97
96
|
<% end %>
|
98
97
|
</ul>
|
99
98
|
</div>
|
100
|
-
<%
|
99
|
+
<% commits.each do |commit| %>
|
101
100
|
<div class="commit">
|
102
|
-
<% commit.
|
101
|
+
<% commit.lines.each_with_index do |line, index| %>
|
103
102
|
<% if index.zero? %>
|
104
|
-
|
105
|
-
<p style="background: gainsboro;" id="<%= details[0] %>"><a href="<%= commit_url %><%= details[0][1..-1] %>"><%= details[0] %></a> by <a href="<%= user %><%= details[1] %>"><%= details[1] %></a> at <span style="color: #275a90;"><%= details[2] %></span>
|
103
|
+
<p style="background: gainsboro;" id="<%= commit.rev %>"><a href="<%= commit_url %><%= commit.rev %>"><%= commit.rev %></a> by <a href="<%= user %><%= commit.author %>"><%= commit.author %></a> at <span style="color: #275a90;"><%= commit.time %></span>
|
106
104
|
<a href="#table-of-contents">↑</a>
|
107
105
|
</p>
|
108
106
|
<% else %>
|
data/lib/messages/svn_grep.erb
CHANGED
@@ -64,14 +64,8 @@
|
|
64
64
|
padding: 36px
|
65
65
|
}
|
66
66
|
|
67
|
-
|
68
|
-
|
69
|
-
border-radius: 3.5px;
|
70
|
-
overflow: hidden;
|
71
|
-
display: inline-block;
|
72
|
-
line-height: 15px;
|
73
|
-
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
74
|
-
border: 1px solid #BCC6CC;
|
67
|
+
td {
|
68
|
+
padding: 2px;
|
75
69
|
}
|
76
70
|
|
77
71
|
.commit * {
|
@@ -86,29 +80,37 @@
|
|
86
80
|
<p>Hi,</p>
|
87
81
|
<p>The following file(s) contain text <code><%= text %></code> in
|
88
82
|
<a href="<%= svn_url %>"><%= svn_url %></a>:</p>
|
89
|
-
|
90
|
-
<
|
91
|
-
<
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
<p
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
<%
|
111
|
-
<p
|
112
|
-
|
83
|
+
<table summary="table with svn commits">
|
84
|
+
<tr>
|
85
|
+
<th id="rev">rev</th>
|
86
|
+
<th id="when">when</th>
|
87
|
+
<th id="author">author</th>
|
88
|
+
<th id="commit_msg" style="text-align: left">commit</th>
|
89
|
+
</tr>
|
90
|
+
<% entries.each do |commit| %>
|
91
|
+
<tr>
|
92
|
+
<td><a href="<%= commit_url %><%= commit.rev %>"><%= commit.rev %></a></td>
|
93
|
+
<td><%= commit.time %></td>
|
94
|
+
<td><a href="<%= user %><%= commit.author %>"><%= commit.author %></a></td>
|
95
|
+
<td>
|
96
|
+
<b><p><%= commit.msg %></p></b>
|
97
|
+
<% commit.diff(text.split(",")).each do |line| %>
|
98
|
+
<% if line.start_with?("+++") || line.start_with?("---") %>
|
99
|
+
<p style="background: gainsboro;"><%= line.gsub(/[<>]/, '<' => '<', '>' => '>') %></p>
|
100
|
+
<% elsif text.split(",").any? { |t| line.include? t } %>
|
101
|
+
<p style="background: #F9F103;"><%= line.gsub(/[<>]/, '<' => '<', '>' => '>') %></p>
|
102
|
+
<% elsif line.start_with?("+") %>
|
103
|
+
<p style="<%= "background: darkseagreen;" %>"><%= line.gsub(/[<>]/, '<' => '<', '>' => '>') %></p>
|
104
|
+
<% elsif line.start_with?("-") %>
|
105
|
+
<p style="<%= "background: lightsalmon;" %>"><%= line.gsub(/[<>]/, '<' => '<', '>' => '>') %></p>
|
106
|
+
<% else %>
|
107
|
+
<p style="background: gainsboro;"><%= line.gsub(/[<>]/, '<' => '<', '>' => '>') %></p>
|
108
|
+
<% end %>
|
109
|
+
<% end %>
|
110
|
+
</td>
|
111
|
+
</tr>
|
112
|
+
<% end %>
|
113
|
+
</table>
|
114
|
+
<p>Posted by<a href="https://github.com/dgroup/lazylead">lazylead v<%= version %></a>.</p>
|
113
115
|
</body>
|
114
116
|
</html>
|
data/readme.md
CHANGED
@@ -48,13 +48,15 @@ Join our telegram group [lazylead.org](https://t.me/lazyleads) for discussions.
|
|
48
48
|
| Create a meeting(s) automatically in case some tickets appeared (group by assignee/reporters/component/ticket type/etc) | ⌛ | ⌛ | ⌛ | ❌ |
|
49
49
|
| Propogate fields from parent tickets to sub-tasks | ✅ | ⌛ | ⌛ | ❌ |
|
50
50
|
| Notify about tickets without comments with expected text | ✅ | ⌛ | ⌛ | ❌ |
|
51
|
-
| Notify about team loading (no tasks on teammates) | ✅ | ⌛ | ⌛ | ❌ |
|
51
|
+
| [Notify about team loading (no tasks on teammates)](lib/lazylead/task/loading.rb) | ✅ | ⌛ | ⌛ | ❌ |
|
52
52
|
| Notify about tickets matches predefined multiple conditions | ✅ | ⌛ | ⌛ | ❌ |
|
53
53
|
| Link automatically the ticket and Confluence page if link found in ticket's comments/description | ✅ | ⌛ | ⌛ | ❌ |
|
54
54
|
| Notify about tickets assigned to your team members not by effective managers| ✅ | ⌛ | ⌛ | ❌ |
|
55
55
|
| Notify about modifications of important files in VCS | ❌ | ⌛ | ❌ | ✅ |
|
56
56
|
| Notify about diff changes for past X period in VCS | ❌ | ⌛ | ❌ | ✅ |
|
57
57
|
| Notify about changes with some text for past X period in VCS | ❌ | ⌛ | ❌ | ✅ |
|
58
|
+
| [Notify when someone outside of your team changed the due date on tickets for your team](lib/lazylead/task/micromanager.rb)| ✅ | ⌛ | ❌ | ❌ |
|
59
|
+
| [Notify when someone outside of your team assigned a ticket directly to the developer](lib/lazylead/task/assignment.rb)| ✅ | ⌛ | ❌ | ❌ |
|
58
60
|
|
59
61
|
| Integration | Type | Status |
|
60
62
|
| :---------------------------------------------------- | :-----------: | :----: |
|
@@ -65,7 +67,7 @@ Join our telegram group [lazylead.org](https://t.me/lazyleads) for discussions.
|
|
65
67
|
| calendar.google.com | Calendar | ⌛ |
|
66
68
|
| slack.com | Notifications | ⌛ |
|
67
69
|
|
68
|
-
✅ - implemented, ⌛ - planned, 🌵 - implemented, but not tested, ❌ - not supported
|
70
|
+
✅ - implemented, ⌛ - planned, 🌵 - implemented, but not tested, ❌ - not supported/planned.
|
69
71
|
|
70
72
|
New ideas, bugs, suggestions or questions are welcome [via GitHub issues](https://github.com/dgroup/lazylead/issues/new)!
|
71
73
|
|
@@ -173,11 +175,12 @@ For simplicity, we are using [docker-compose](https://docs.docker.com/compose/):
|
|
173
175
|
```
|
174
176
|
|
175
177
|
### How to contribute?
|
176
|
-
[](http://www.elegantobjects.org/#principles)
|
177
178
|
|
178
|
-
|
179
|
+
<a href="https://www.buymeacoffee.com/lazylead" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
|
180
|
+
|
181
|
+
[Pull requests](http://www.elegantobjects.org/#principles) are welcome! Don't forget to add your name to contribution section and run this, beforehand:
|
179
182
|
```ruby
|
180
|
-
|
183
|
+
rake -A
|
181
184
|
```
|
182
185
|
Everyone interacting in this project’s codebases, issue trackers, chat rooms is expected to follow the [code of conduct](.github/CODE_OF_CONDUCT.md).
|
183
186
|
|
@@ -194,5 +194,13 @@ module Lazylead
|
|
194
194
|
"context_path" => ""
|
195
195
|
).issues("key=DATAJDBC-480")
|
196
196
|
end
|
197
|
+
|
198
|
+
test "sprint is found" do
|
199
|
+
assert_equal "Sprint 68",
|
200
|
+
NoAuthJira.new("https://jira.spring.io")
|
201
|
+
.issues("key=XD-3744", fields: ["customfield_10480"])
|
202
|
+
.first
|
203
|
+
.sprint("customfield_10480")
|
204
|
+
end
|
197
205
|
end
|
198
206
|
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# The MIT License
|
4
|
+
#
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
|
+
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"),
|
9
|
+
# to deal in the Software without restriction, including without limitation
|
10
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
11
|
+
# and/or sell copies of the Software, and to permit persons to whom
|
12
|
+
# the Software is furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included
|
15
|
+
# in all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
22
|
+
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
23
|
+
# OR OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
|
25
|
+
require_relative "../../../test"
|
26
|
+
require_relative "../../../../lib/lazylead/task/accuracy/logs_link"
|
27
|
+
|
28
|
+
module Lazylead
|
29
|
+
class LogsLinkTest < Lazylead::Test
|
30
|
+
test "log file is present" do
|
31
|
+
assert LogsLink.new("https://mygraylog.com/log#5").passed(
|
32
|
+
OpenStruct.new(
|
33
|
+
attachments: [OpenStruct.new(attrs: { "size" => 10_241, "filename" => "catalina.log" })]
|
34
|
+
)
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
test "log file is absent but description has log reference" do
|
39
|
+
assert LogsLink.new("https://mygraylog.com").passed(
|
40
|
+
OpenStruct.new(description: "Here is the log for current ticket https://mygraylog.com/log#5")
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
test "log file is absent and link is absent" do
|
45
|
+
refute LogsLink.new("https://mygraylog.com").passed(
|
46
|
+
OpenStruct.new(attachments: [])
|
47
|
+
)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -65,12 +65,10 @@ module Lazylead
|
|
65
65
|
end
|
66
66
|
|
67
67
|
test "issue has two .png files with reference in description but with extension mismatch" do
|
68
|
-
refute Screenshots.new.passed(
|
68
|
+
refute Screenshots.new(minimum: 2).passed(
|
69
69
|
OpenStruct.new(
|
70
70
|
description: "Hi,\n here are snapshots !img1.jpg|thumbnail!\n!img2.jpg|thumbnail!\n",
|
71
|
-
fields: {
|
72
|
-
"description" => "Hi,\n here are snapshots !img1.jpg|thumbnail!\n!img2.jpg|thumbnail!\n"
|
73
|
-
},
|
71
|
+
fields: { "description" => "-" },
|
74
72
|
attachments: [
|
75
73
|
OpenStruct.new("filename" => "img1.JPG"),
|
76
74
|
OpenStruct.new("filename" => "img2.jpg")
|
@@ -273,6 +273,40 @@ module Lazylead
|
|
273
273
|
*{color:#DE10AA}[AR]{color}* = YYYY"
|
274
274
|
end
|
275
275
|
|
276
|
+
test "TC named use case" do
|
277
|
+
assert testcase? "{color:#0747a6}+*Use case*+{color}
|
278
|
+
# Step 1
|
279
|
+
# Step ..
|
280
|
+
# Step N
|
281
|
+
*{color:#00673A}[ER]{color}* = XXXX
|
282
|
+
*{color:#DE10AA}[AR]{color}* = YYYY"
|
283
|
+
end
|
284
|
+
|
285
|
+
test "TC with full ar er words" do
|
286
|
+
assert testcase? "{color:#0747a6}+*Use case*+{color}
|
287
|
+
# Step 1
|
288
|
+
# Step ..
|
289
|
+
# Step N
|
290
|
+
*{color:#00673A}Expected result:{color}* = XXXX
|
291
|
+
*{color:#DE10AA}Actual Result:{color}* = YYYY"
|
292
|
+
end
|
293
|
+
|
294
|
+
test "TC with prerequisites" do
|
295
|
+
assert testcase? "{color:#0747a6}+*Pre-requisites and Steps:*+{color}
|
296
|
+
# Step 1
|
297
|
+
# Step ..
|
298
|
+
# Step N
|
299
|
+
*{color:#00673A}Expected result:{color}* = XXXX
|
300
|
+
*{color:#DE10AA}Actual Result:{color}* = YYYY"
|
301
|
+
end
|
302
|
+
|
303
|
+
test "TC with h3" do
|
304
|
+
assert testcase? "h3. Steps: Start updating
|
305
|
+
h3. ER: updating failed
|
306
|
+
h3. AR: updating should be passed
|
307
|
+
h3. Screenshots: !r37.png|thumbnail!"
|
308
|
+
end
|
309
|
+
|
276
310
|
# ensure that issue description has a test case, AR and ER
|
277
311
|
def testcase?(desc)
|
278
312
|
Testcase.new.passed(OpenStruct.new(description: desc))
|
@@ -48,7 +48,8 @@ module Lazylead
|
|
48
48
|
"template" => "lib/messages/alertif.erb"
|
49
49
|
)
|
50
50
|
)
|
51
|
-
assert_email "[LL] alert if",
|
51
|
+
assert_email "[LL] alert if",
|
52
|
+
"XD-3064", "Critical", "Done", "Glenn Renfro", "Thomas Risberg", "HdfsMongoDB"
|
52
53
|
end
|
53
54
|
end
|
54
55
|
end
|
@@ -47,7 +47,8 @@ module Lazylead
|
|
47
47
|
)
|
48
48
|
)
|
49
49
|
assert_email "Assignment: How dare you?",
|
50
|
-
|
50
|
+
"DATAJDBC-480", "01-Apr", "Minor", "Mark Paluch", "tom,mike,bob",
|
51
|
+
"EntityInstantiators"
|
51
52
|
end
|
52
53
|
end
|
53
54
|
end
|
@@ -82,7 +82,7 @@ module Lazylead
|
|
82
82
|
)
|
83
83
|
)
|
84
84
|
assert_email "[DD] HMCHT!",
|
85
|
-
|
85
|
+
"STS-3599", "2013-11-08", "Major", "Miles Parker", "Use JavaFX WebView"
|
86
86
|
end
|
87
87
|
|
88
88
|
test "send notification about bunch of tickets" do
|
@@ -100,7 +100,7 @@ module Lazylead
|
|
100
100
|
)
|
101
101
|
)
|
102
102
|
assert_email "ALRT: Frozen",
|
103
|
-
|
103
|
+
"Hi Boss", "STS-3599", "2013-11-08", "Major", "Miles Parker", "Use JavaFX WebView"
|
104
104
|
end
|
105
105
|
|
106
106
|
test "cc got notification" do
|
@@ -48,7 +48,8 @@ module Lazylead
|
|
48
48
|
)
|
49
49
|
)
|
50
50
|
assert_email "FixVersion: How dare you?",
|
51
|
-
|
51
|
+
"DATAJDBC-480", "01-Apr-2020", "Minor", "Mark Paluch", "tom,mike,bob",
|
52
|
+
"EntityInstantiators"
|
52
53
|
end
|
53
54
|
end
|
54
55
|
end
|
@@ -41,15 +41,19 @@ module Lazylead
|
|
41
41
|
"to" => "lead@company.com",
|
42
42
|
"from" => "ll@company.com",
|
43
43
|
"jql" => "key in (STS-3599, XD-3739, XD-3744)",
|
44
|
-
"team" => "mclaren:Tom McLaren,milesparker:Mi Pa",
|
44
|
+
"team" => "mclaren:Tom McLaren,milesparker:Mi Pa,grussell:Gary Ru",
|
45
45
|
"user_link" => "https://user.com?id=",
|
46
46
|
"search_link" => "https://jira.spring.io/issues/?jql=",
|
47
47
|
"fields" => "assignee,duedate,customfield_10480",
|
48
|
+
"sprint" => "customfield_10480",
|
48
49
|
"subject" => "[LL] Team loading",
|
49
50
|
"template" => "lib/messages/loading.erb"
|
50
51
|
)
|
51
52
|
)
|
52
|
-
assert_email "[LL] Team loading",
|
53
|
+
assert_email "[LL] Team loading",
|
54
|
+
"grussell", "Gary Ru", "Sprint 68", "1",
|
55
|
+
"Miles Parker", "No sprint: 1", "2013-11-08",
|
56
|
+
"Tom McLaren", "0"
|
53
57
|
end
|
54
58
|
end
|
55
59
|
end
|
@@ -43,12 +43,19 @@ module Lazylead
|
|
43
43
|
"jql" => "key in ('STS-3599','SPR-6541') and duedate is not empty",
|
44
44
|
"fields" => "assignee,duedate,priority,created,summary,reporter",
|
45
45
|
"allowed" => "tom,mike,bob",
|
46
|
+
"period" => "86400",
|
47
|
+
"now" => "2009-12-10T00:04:00.000+0000",
|
46
48
|
"subject" => "DD: How dare you?",
|
47
49
|
"template" => "lib/messages/illegal_duedate_change.erb"
|
48
50
|
)
|
49
51
|
)
|
50
52
|
assert_email "DD: How dare you?",
|
51
|
-
|
53
|
+
"SPR-6541", "Major", "(kdonald)", "2009-12-10", "Spring's Maven Central", "tom,mike,bob"
|
54
|
+
end
|
55
|
+
|
56
|
+
test "since for past 1 min" do
|
57
|
+
greater_or_eq Task::Micromanager.new.since("period" => 60).to_i,
|
58
|
+
(Time.now - 60).to_i
|
52
59
|
end
|
53
60
|
end
|
54
61
|
end
|
@@ -50,7 +50,7 @@ module Lazylead
|
|
50
50
|
)
|
51
51
|
)
|
52
52
|
assert_email "Expected ftp link is missing",
|
53
|
-
|
53
|
+
"DATAJDBC-523", "Major", "Mark Paluch", "https://github.com/spring-projects/spring-data-jdbc/commit/aadbb667ed1d61139d5ac51a06eb3dd1b39316db#diff-510a5041bb8a0575e97fedf105606b83R130"
|
54
54
|
end
|
55
55
|
end
|
56
56
|
end
|
@@ -57,7 +57,7 @@ module Lazylead
|
|
57
57
|
"template-attachment" => "lib/messages/svn_diff_attachment.erb"
|
58
58
|
)
|
59
59
|
)
|
60
|
-
assert_email_line "[SVN] Changed since rev1", %w[r2 by dgroup at
|
60
|
+
assert_email_line "[SVN] Changed since rev1", %w[r2 by dgroup at 16-08-2020]
|
61
61
|
# assert_attachment "[SVN] Changed since rev1", /^.*svn-log-.*.html.zip$/
|
62
62
|
end
|
63
63
|
|
@@ -28,6 +28,7 @@ require_relative "../../../../lib/lazylead/smtp"
|
|
28
28
|
require_relative "../../../../lib/lazylead/opts"
|
29
29
|
require_relative "../../../../lib/lazylead/postman"
|
30
30
|
require_relative "../../../../lib/lazylead/task/svn/grep"
|
31
|
+
require_relative "../../../../lib/lazylead/task/svn/svn"
|
31
32
|
|
32
33
|
module Lazylead
|
33
34
|
class GrepTest < Lazylead::Test
|
@@ -96,7 +97,7 @@ module Lazylead
|
|
96
97
|
|
97
98
|
|
98
99
|
MSG
|
99
|
-
assert_equal 15,
|
100
|
+
assert_equal 15, Lazylead::Svn::Commit.new(diff).diff(%w[ping]).size,
|
100
101
|
"There is one commit with 'ping' word where diff has 14 lines"
|
101
102
|
end
|
102
103
|
end
|
data/test/test.rb
CHANGED
@@ -79,9 +79,9 @@ module Lazylead
|
|
79
79
|
end
|
80
80
|
|
81
81
|
# Assert that text contains expected words
|
82
|
-
def assert_words(words, text)
|
82
|
+
def assert_words(*words, text)
|
83
83
|
words = [words] unless words.respond_to? :each
|
84
|
-
words.each do |w|
|
84
|
+
words.first.each do |w|
|
85
85
|
assert_includes text, w
|
86
86
|
end
|
87
87
|
end
|
@@ -103,7 +103,8 @@ module Lazylead
|
|
103
103
|
|
104
104
|
# Assert that email sent using 'mail' gem in test mode
|
105
105
|
# has expected subject and words
|
106
|
-
def assert_email(subject, words)
|
106
|
+
def assert_email(subject, *words)
|
107
|
+
refute_empty words, "No words provided to match"
|
107
108
|
email = Mail::TestMailer.deliveries
|
108
109
|
.find { |m| m.subject.eql? subject }
|
109
110
|
refute_nil email, "No email found with subject: #{subject}"
|