lazylead 0.9.1 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/Rakefile +1 -2
  4. data/lazylead.gemspec +13 -13
  5. data/lib/lazylead/confluence.rb +1 -2
  6. data/lib/lazylead/os.rb +55 -0
  7. data/lib/lazylead/task/accuracy/accuracy.rb +2 -3
  8. data/lib/lazylead/task/accuracy/attachment.rb +1 -0
  9. data/lib/lazylead/task/accuracy/environment.rb +3 -8
  10. data/lib/lazylead/task/accuracy/logs_link.rb +52 -0
  11. data/lib/lazylead/task/accuracy/records.rb +1 -1
  12. data/lib/lazylead/task/accuracy/required.rb +43 -0
  13. data/lib/lazylead/task/accuracy/screenshots.rb +2 -3
  14. data/lib/lazylead/task/accuracy/servers.rb +7 -7
  15. data/lib/lazylead/task/accuracy/testcase.rb +27 -20
  16. data/lib/lazylead/task/fix_version.rb +5 -8
  17. data/lib/lazylead/task/loading.rb +3 -2
  18. data/lib/lazylead/task/micromanager.rb +27 -3
  19. data/lib/lazylead/task/svn/diff.rb +9 -9
  20. data/lib/lazylead/task/svn/grep.rb +8 -71
  21. data/lib/lazylead/task/svn/svn.rb +107 -0
  22. data/lib/lazylead/task/svn/touch.rb +5 -7
  23. data/lib/lazylead/version.rb +1 -1
  24. data/lib/messages/illegal_assignee_change.erb +1 -2
  25. data/lib/messages/illegal_duedate_change.erb +5 -3
  26. data/lib/messages/loading.erb +2 -2
  27. data/lib/messages/svn_diff.erb +29 -29
  28. data/lib/messages/svn_diff_attachment.erb +5 -7
  29. data/lib/messages/svn_grep.erb +34 -32
  30. data/readme.md +8 -5
  31. data/test/lazylead/system/jira_test.rb +8 -0
  32. data/test/lazylead/task/accuracy/accuracy_test.rb +1 -1
  33. data/test/lazylead/task/accuracy/logs_link_test.rb +50 -0
  34. data/test/lazylead/task/accuracy/onlyll_test.rb +1 -1
  35. data/test/lazylead/task/accuracy/screenshots_test.rb +2 -4
  36. data/test/lazylead/task/accuracy/testcase_test.rb +34 -0
  37. data/test/lazylead/task/alert/alertif_test.rb +2 -1
  38. data/test/lazylead/task/assignment_test.rb +2 -1
  39. data/test/lazylead/task/created_recently_test.rb +2 -1
  40. data/test/lazylead/task/duedate_test.rb +2 -2
  41. data/test/lazylead/task/fix_version_test.rb +2 -1
  42. data/test/lazylead/task/loading_test.rb +6 -2
  43. data/test/lazylead/task/micromanager_test.rb +8 -1
  44. data/test/lazylead/task/missing_comment_test.rb +1 -1
  45. data/test/lazylead/task/svn/diff_test.rb +1 -1
  46. data/test/lazylead/task/svn/grep_test.rb +2 -1
  47. data/test/test.rb +4 -3
  48. 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
- <% stdout.split("------------------------------------------------------------------------").reject(&:blank?).reverse.each do |commit| %>
95
- <% details = commit.split("\n").reject(&:blank?).first.split("|").map(&:strip).reject(&:blank?) %>
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
- <% stdout.split("------------------------------------------------------------------------").reject(&:blank?).reverse.each do |commit| %>
99
+ <% commits.each do |commit| %>
101
100
  <div class="commit">
102
- <% commit.split("\n").reject(&:blank?).each_with_index do |line, index| %>
101
+ <% commit.lines.each_with_index do |line, index| %>
103
102
  <% if index.zero? %>
104
- <% details = line.split("|").map(&:strip).reject(&:blank?) %>
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">&#8593;</a>
107
105
  </p>
108
106
  <% else %>
@@ -64,14 +64,8 @@
64
64
  padding: 36px
65
65
  }
66
66
 
67
- .commit {
68
- min-width: 100%;
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
- <% entries.each do |commit| %>
90
- <div class="commit">
91
- <p style="background: gainsboro;">
92
- <a href="<%= commit_url %><%= commit.rev %>"><%= commit.msg %></a>
93
- by <a href="<%= user %><%= commit.author %>"><%= commit.author %></a>
94
- at <span style="color: #275a90;"><%= commit.time %></span>
95
- </p>
96
- <% commit.diff(text.split(",")).each do |line| %>
97
- <% if line.start_with?("+++") || line.start_with?("---") %>
98
- <p style="background: gainsboro;"><%= line.gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;') %></p>
99
- <% elsif text.split(",").any? { |t| line.include? t } %>
100
- <p style="background: #F9F103;"><%= line.gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;') %></p>
101
- <% elsif line.start_with?("+") %>
102
- <p style="<%= "background: darkseagreen;" %>"><%= line.gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;') %></p>
103
- <% elsif line.start_with?("-") %>
104
- <p style="<%= "background: lightsalmon;" %>"><%= line.gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;') %></p>
105
- <% else %>
106
- <p style="background: gainsboro;"><%= line.gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;') %></p>
107
- <% end %>
108
- <% end %>
109
- </div>
110
- <% end %>
111
- <p>Posted by<a href="https://github.com/dgroup/lazylead">lazylead
112
- v<%= version %></a>.</p>
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(/[<>]/, '<' => '&lt;', '>' => '&gt;') %></p>
100
+ <% elsif text.split(",").any? { |t| line.include? t } %>
101
+ <p style="background: #F9F103;"><%= line.gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;') %></p>
102
+ <% elsif line.start_with?("+") %>
103
+ <p style="<%= "background: darkseagreen;" %>"><%= line.gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;') %></p>
104
+ <% elsif line.start_with?("-") %>
105
+ <p style="<%= "background: lightsalmon;" %>"><%= line.gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;') %></p>
106
+ <% else %>
107
+ <p style="background: gainsboro;"><%= line.gsub(/[<>]/, '<' => '&lt;', '>' => '&gt;') %></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 by ticketing system.
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
- [![EO badge](http://www.elegantobjects.org/badge.svg)](http://www.elegantobjects.org/#principles)
177
178
 
178
- Pull requests are welcome! Don't forget to add your name to contribution section and run this, beforehand:
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
- bundle exec rake
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
@@ -56,7 +56,7 @@ module Lazylead
56
56
  )
57
57
  )
58
58
  assert_email "[LL] Raised tickets",
59
- %w[DATAJDBC-493 0.5 100% MyeongHyeonLee Deadlock\ occurs]
59
+ "DATAJDBC-493", "0.5", "100%", "MyeongHyeonLee", "Deadlock occurs"
60
60
  end
61
61
 
62
62
  test "construct accuracy from orm" do
@@ -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
@@ -69,7 +69,7 @@ module Lazylead
69
69
  )
70
70
  )
71
71
  assert_email "[LL] Only",
72
- %w[XD-3725 Blocker EmbeddedHeadersMessageConverter]
72
+ "XD-3725", "Blocker", "EmbeddedHeadersMessageConverter"
73
73
  end
74
74
 
75
75
  test "detect score" do
@@ -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", %w[XD-3064 Critical Done Glenn Risberg HdfsMongoDB]
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
- %w[DATAJDBC-480 01-Apr-2020 Minor Mark\ Paluch tom,mike,bob EntityInstantiators]
50
+ "DATAJDBC-480", "01-Apr", "Minor", "Mark Paluch", "tom,mike,bob",
51
+ "EntityInstantiators"
51
52
  end
52
53
  end
53
54
  end
@@ -47,7 +47,8 @@ module Lazylead
47
47
  "template" => "lib/messages/created_recently.erb"
48
48
  )
49
49
  )
50
- assert_email "[CR] 20min ago!", %w[XD-3766 SGF-726]
50
+ assert_email "[CR] 20min ago!",
51
+ "XD-3766", "SGF-726"
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
- %w[STS-3599 2013-11-08 Major Miles\ Parker Use JavaFX WebView]
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
- %w[Hi Boss STS-3599 2013-11-08 Major Miles\ Parker Use JavaFX WebView]
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
- %w[DATAJDBC-480 01-Apr-2020 Minor Mark\ Paluch tom,mike,bob EntityInstantiators]
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", %w[mclaren Tom McLaren 0]
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
- %w[SPR-6541 Major (kdonald) 2009-12-10 Spring's\ Maven\ Central tom,mike,bob]
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
- %w[DATAJDBC-523 Major Mark\ Paluch https://github.com/spring-projects/spring-data-jdbc/commit/aadbb667ed1d61139d5ac51a06eb3dd1b39316db#diff-510a5041bb8a0575e97fedf105606b83R130]
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 2020-08-16]
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, Entry.new(diff).diff(%w[ping]).size,
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}"