exception_notification 5.0.0 → 5.0.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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.rdoc +14 -0
  3. data/exception_notification.gemspec +9 -2
  4. data/lib/exception_notification/version.rb +1 -1
  5. metadata +2 -31
  6. data/Gemfile +0 -5
  7. data/Gemfile.lock +0 -346
  8. data/gemfiles/pinned_dependencies.gemfile +0 -8
  9. data/gemfiles/rails7_1.gemfile +0 -5
  10. data/gemfiles/rails7_2.gemfile +0 -5
  11. data/gemfiles/rails8_0.gemfile +0 -5
  12. data/test/exception_notification/rack_test.rb +0 -106
  13. data/test/exception_notification/rake_test.rb +0 -38
  14. data/test/exception_notification/resque_test.rb +0 -54
  15. data/test/exception_notifier/datadog_notifier_test.rb +0 -154
  16. data/test/exception_notifier/email_notifier_test.rb +0 -342
  17. data/test/exception_notifier/google_chat_notifier_test.rb +0 -185
  18. data/test/exception_notifier/hipchat_notifier_test.rb +0 -220
  19. data/test/exception_notifier/irc_notifier_test.rb +0 -139
  20. data/test/exception_notifier/mattermost_notifier_test.rb +0 -251
  21. data/test/exception_notifier/modules/error_grouping_test.rb +0 -167
  22. data/test/exception_notifier/modules/formatter_test.rb +0 -154
  23. data/test/exception_notifier/sidekiq_test.rb +0 -41
  24. data/test/exception_notifier/slack_notifier_test.rb +0 -228
  25. data/test/exception_notifier/sns_notifier_test.rb +0 -181
  26. data/test/exception_notifier/teams_notifier_test.rb +0 -92
  27. data/test/exception_notifier/webhook_notifier_test.rb +0 -98
  28. data/test/exception_notifier_test.rb +0 -298
  29. data/test/support/exception_notifier_helper.rb +0 -14
  30. data/test/support/views/exception_notifier/_new_bkg_section.html.erb +0 -1
  31. data/test/support/views/exception_notifier/_new_bkg_section.text.erb +0 -1
  32. data/test/support/views/exception_notifier/_new_section.html.erb +0 -1
  33. data/test/support/views/exception_notifier/_new_section.text.erb +0 -1
  34. data/test/test_helper.rb +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7052b1e076f4ff2aac2a4aa139d0ddb2a2b6f5b3af1afcc4323e1c8f347db04
4
- data.tar.gz: 54f3386901d556ec7c3544533d94a5757490645e677b42c325721cef5d4787ae
3
+ metadata.gz: 6954f714e7b2d72fa089f11b1f0ce8e8ad528d8a47c1e7e77015803374855f8f
4
+ data.tar.gz: e8ee6f6f4ca0e630b93c23272b0a50431b2300c2d4fb3aa7d1a4f1ed03691bbb
5
5
  SHA512:
6
- metadata.gz: 68f0a94a1167c436ececbfcf4a48df910e0dd719d3b2385f790a24b285276a48989dbc27cf2e24b26a6e98221cea008192218af4405f6ce954d807b3705357ef
7
- data.tar.gz: c28bf196e2ce258608c55614d3e42ca8053dc8e7a18b854aa78c8c54fc097f099b9f1d51313a72a7f677b3adb30b0403f7863c90acad78c72ca0e17a5eede527
6
+ metadata.gz: 4f28a522bed1fd0e871af5c75ea1988d943938e5a94b50cea01131e48d13847fced2909e4649bb28330a066c5492a9b944d8f1bf736a8008ff7498db4187701c
7
+ data.tar.gz: 89cd0969d52dcc01fb22b4966dc02d5d2ece2453380ef7ebcf2d3d2b6a2e40aa60fb80bea4c58d39eea7a4e6b0bb6489f541ccaaf22b022fedd5516d4b9b17bc
data/CHANGELOG.rdoc CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  nil
4
4
 
5
+ == 5.0.1
6
+
7
+ * Change packaged gem files. Remove unnecessary files which cause warnings in some envs. #9 (@brianclinkenbeard)
8
+
9
+ == 5.0.0
10
+
11
+ * Switch linter to Standardrb. Remove Rubocop.
12
+ * Change default ruby version to 3.4.2.
13
+ * Drop support for old Rails and Ruby versions. Require Rails 7.1 and Ruby 3.2 at least.
14
+ * Add two Rails exceptions to the ignore list: ActionDispatch::Http::MimeNegotiation::InvalidType Rack::Utils::InvalidParameterError
15
+ * Fix some warnings and patches around sidekiq.
16
+ * General repo tidying and updating.
17
+ (All by @kmcphillips)
18
+
5
19
  == 4.6.0
6
20
 
7
21
  https://github.com/smartinez87/exception_notification/releases/tag/v4.6.0
@@ -14,8 +14,15 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.required_ruby_version = ">= 3.2"
16
16
 
17
- s.files = `git ls-files | grep -v '^examples'`.split("\n")
18
- s.files -= `git ls-files -- .??*`.split("\n")
17
+ s.files = Dir[
18
+ "lib/**/*",
19
+ "docs/**/*",
20
+ "MIT-LICENSE",
21
+ "exception_notification.gemspec",
22
+ "Rakefile",
23
+ "*.md",
24
+ "*.rdoc"
25
+ ].reject { |f| File.directory?(f) }
19
26
  s.require_path = "lib"
20
27
 
21
28
  s.add_dependency("actionmailer", ">= 7.1", "< 9")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ExceptionNotification
4
- VERSION = "5.0.0"
4
+ VERSION = "5.0.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exception_notification
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamis Buck
@@ -10,7 +10,7 @@ authors:
10
10
  - Kevin McPhillips
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-03-22 00:00:00.000000000 Z
13
+ date: 2025-08-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: actionmailer
@@ -276,8 +276,6 @@ files:
276
276
  - CHANGELOG.rdoc
277
277
  - CODE_OF_CONDUCT.md
278
278
  - CONTRIBUTING.md
279
- - Gemfile
280
- - Gemfile.lock
281
279
  - MIT-LICENSE
282
280
  - README.md
283
281
  - Rakefile
@@ -294,10 +292,6 @@ files:
294
292
  - docs/notifiers/teams.md
295
293
  - docs/notifiers/webhook.md
296
294
  - exception_notification.gemspec
297
- - gemfiles/pinned_dependencies.gemfile
298
- - gemfiles/rails7_1.gemfile
299
- - gemfiles/rails7_2.gemfile
300
- - gemfiles/rails8_0.gemfile
301
295
  - lib/exception_notification.rb
302
296
  - lib/exception_notification/rack.rb
303
297
  - lib/exception_notification/rails.rb
@@ -340,29 +334,6 @@ files:
340
334
  - lib/exception_notifier/webhook_notifier.rb
341
335
  - lib/generators/exception_notification/install_generator.rb
342
336
  - lib/generators/exception_notification/templates/exception_notification.rb.erb
343
- - test/exception_notification/rack_test.rb
344
- - test/exception_notification/rake_test.rb
345
- - test/exception_notification/resque_test.rb
346
- - test/exception_notifier/datadog_notifier_test.rb
347
- - test/exception_notifier/email_notifier_test.rb
348
- - test/exception_notifier/google_chat_notifier_test.rb
349
- - test/exception_notifier/hipchat_notifier_test.rb
350
- - test/exception_notifier/irc_notifier_test.rb
351
- - test/exception_notifier/mattermost_notifier_test.rb
352
- - test/exception_notifier/modules/error_grouping_test.rb
353
- - test/exception_notifier/modules/formatter_test.rb
354
- - test/exception_notifier/sidekiq_test.rb
355
- - test/exception_notifier/slack_notifier_test.rb
356
- - test/exception_notifier/sns_notifier_test.rb
357
- - test/exception_notifier/teams_notifier_test.rb
358
- - test/exception_notifier/webhook_notifier_test.rb
359
- - test/exception_notifier_test.rb
360
- - test/support/exception_notifier_helper.rb
361
- - test/support/views/exception_notifier/_new_bkg_section.html.erb
362
- - test/support/views/exception_notifier/_new_bkg_section.text.erb
363
- - test/support/views/exception_notifier/_new_section.html.erb
364
- - test/support/views/exception_notifier/_new_section.text.erb
365
- - test/test_helper.rb
366
337
  homepage: https://kmcphillips.github.io/exception_notification/
367
338
  licenses:
368
339
  - MIT
data/Gemfile DELETED
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- gemspec
data/Gemfile.lock DELETED
@@ -1,346 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- exception_notification (5.0.0)
5
- actionmailer (>= 7.1, < 9)
6
- activesupport (>= 7.1, < 9)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- actioncable (8.0.2)
12
- actionpack (= 8.0.2)
13
- activesupport (= 8.0.2)
14
- nio4r (~> 2.0)
15
- websocket-driver (>= 0.6.1)
16
- zeitwerk (~> 2.6)
17
- actionmailbox (8.0.2)
18
- actionpack (= 8.0.2)
19
- activejob (= 8.0.2)
20
- activerecord (= 8.0.2)
21
- activestorage (= 8.0.2)
22
- activesupport (= 8.0.2)
23
- mail (>= 2.8.0)
24
- actionmailer (8.0.2)
25
- actionpack (= 8.0.2)
26
- actionview (= 8.0.2)
27
- activejob (= 8.0.2)
28
- activesupport (= 8.0.2)
29
- mail (>= 2.8.0)
30
- rails-dom-testing (~> 2.2)
31
- actionpack (8.0.2)
32
- actionview (= 8.0.2)
33
- activesupport (= 8.0.2)
34
- nokogiri (>= 1.8.5)
35
- rack (>= 2.2.4)
36
- rack-session (>= 1.0.1)
37
- rack-test (>= 0.6.3)
38
- rails-dom-testing (~> 2.2)
39
- rails-html-sanitizer (~> 1.6)
40
- useragent (~> 0.16)
41
- actiontext (8.0.2)
42
- actionpack (= 8.0.2)
43
- activerecord (= 8.0.2)
44
- activestorage (= 8.0.2)
45
- activesupport (= 8.0.2)
46
- globalid (>= 0.6.0)
47
- nokogiri (>= 1.8.5)
48
- actionview (8.0.2)
49
- activesupport (= 8.0.2)
50
- builder (~> 3.1)
51
- erubi (~> 1.11)
52
- rails-dom-testing (~> 2.2)
53
- rails-html-sanitizer (~> 1.6)
54
- activejob (8.0.2)
55
- activesupport (= 8.0.2)
56
- globalid (>= 0.3.6)
57
- activemodel (8.0.2)
58
- activesupport (= 8.0.2)
59
- activerecord (8.0.2)
60
- activemodel (= 8.0.2)
61
- activesupport (= 8.0.2)
62
- timeout (>= 0.4.0)
63
- activestorage (8.0.2)
64
- actionpack (= 8.0.2)
65
- activejob (= 8.0.2)
66
- activerecord (= 8.0.2)
67
- activesupport (= 8.0.2)
68
- marcel (~> 1.0)
69
- activesupport (8.0.2)
70
- base64
71
- benchmark (>= 0.3)
72
- bigdecimal
73
- concurrent-ruby (~> 1.0, >= 1.3.1)
74
- connection_pool (>= 2.2.5)
75
- drb
76
- i18n (>= 1.6, < 2)
77
- logger (>= 1.4.2)
78
- minitest (>= 5.1)
79
- securerandom (>= 0.3)
80
- tzinfo (~> 2.0, >= 2.0.5)
81
- uri (>= 0.13.1)
82
- addressable (2.8.7)
83
- public_suffix (>= 2.0.2, < 7.0)
84
- ast (2.4.3)
85
- aws-eventstream (1.3.2)
86
- aws-partitions (1.1071.0)
87
- aws-sdk-core (3.220.2)
88
- aws-eventstream (~> 1, >= 1.3.0)
89
- aws-partitions (~> 1, >= 1.992.0)
90
- aws-sigv4 (~> 1.9)
91
- base64
92
- jmespath (~> 1, >= 1.6.1)
93
- aws-sdk-sns (1.97.0)
94
- aws-sdk-core (~> 3, >= 3.216.0)
95
- aws-sigv4 (~> 1.5)
96
- aws-sigv4 (1.11.0)
97
- aws-eventstream (~> 1, >= 1.0.2)
98
- base64 (0.2.0)
99
- benchmark (0.4.0)
100
- bigdecimal (3.1.9)
101
- builder (3.3.0)
102
- carrier-pigeon (0.7.0)
103
- addressable
104
- concurrent-ruby (1.3.5)
105
- connection_pool (2.5.0)
106
- crass (1.0.6)
107
- date (3.4.1)
108
- dogapi (1.45.0)
109
- multi_json
110
- drb (2.2.1)
111
- erubi (1.13.1)
112
- globalid (1.2.1)
113
- activesupport (>= 6.1)
114
- hipchat (1.6.0)
115
- httparty
116
- mimemagic
117
- httparty (0.10.2)
118
- multi_json (~> 1.0)
119
- multi_xml (>= 0.5.2)
120
- i18n (1.14.7)
121
- concurrent-ruby (~> 1.0)
122
- io-console (0.8.0)
123
- irb (1.15.1)
124
- pp (>= 0.6.0)
125
- rdoc (>= 4.0.0)
126
- reline (>= 0.4.2)
127
- jmespath (1.6.2)
128
- json (2.10.2)
129
- language_server-protocol (3.17.0.4)
130
- lint_roller (1.1.0)
131
- logger (1.6.6)
132
- loofah (2.24.0)
133
- crass (~> 1.0.2)
134
- nokogiri (>= 1.12.0)
135
- mail (2.8.1)
136
- mini_mime (>= 0.1.1)
137
- net-imap
138
- net-pop
139
- net-smtp
140
- marcel (1.0.4)
141
- mimemagic (0.4.3)
142
- nokogiri (~> 1)
143
- rake
144
- mini_mime (1.1.5)
145
- minitest (5.25.5)
146
- mocha (2.7.1)
147
- ruby2_keywords (>= 0.0.5)
148
- mock_redis (0.19.0)
149
- multi_json (1.15.0)
150
- multi_xml (0.7.1)
151
- bigdecimal (~> 3.1)
152
- mustermann (3.0.3)
153
- ruby2_keywords (~> 0.0.1)
154
- net-imap (0.5.6)
155
- date
156
- net-protocol
157
- net-pop (0.1.2)
158
- net-protocol
159
- net-protocol (0.2.2)
160
- timeout
161
- net-smtp (0.5.1)
162
- net-protocol
163
- nio4r (2.7.4)
164
- nokogiri (1.18.5-aarch64-linux-gnu)
165
- racc (~> 1.4)
166
- nokogiri (1.18.5-aarch64-linux-musl)
167
- racc (~> 1.4)
168
- nokogiri (1.18.5-arm-linux-gnu)
169
- racc (~> 1.4)
170
- nokogiri (1.18.5-arm-linux-musl)
171
- racc (~> 1.4)
172
- nokogiri (1.18.5-arm64-darwin)
173
- racc (~> 1.4)
174
- nokogiri (1.18.5-x86_64-darwin)
175
- racc (~> 1.4)
176
- nokogiri (1.18.5-x86_64-linux-gnu)
177
- racc (~> 1.4)
178
- nokogiri (1.18.5-x86_64-linux-musl)
179
- racc (~> 1.4)
180
- ostruct (0.6.1)
181
- parallel (1.26.3)
182
- parser (3.3.7.2)
183
- ast (~> 2.4.1)
184
- racc
185
- pp (0.6.2)
186
- prettyprint
187
- prettyprint (0.2.0)
188
- psych (5.2.3)
189
- date
190
- stringio
191
- public_suffix (6.0.1)
192
- racc (1.8.1)
193
- rack (3.1.12)
194
- rack-protection (4.1.1)
195
- base64 (>= 0.1.0)
196
- logger (>= 1.6.0)
197
- rack (>= 3.0.0, < 4)
198
- rack-session (2.1.0)
199
- base64 (>= 0.1.0)
200
- rack (>= 3.0.0)
201
- rack-test (2.2.0)
202
- rack (>= 1.3)
203
- rackup (2.2.1)
204
- rack (>= 3)
205
- rails (8.0.2)
206
- actioncable (= 8.0.2)
207
- actionmailbox (= 8.0.2)
208
- actionmailer (= 8.0.2)
209
- actionpack (= 8.0.2)
210
- actiontext (= 8.0.2)
211
- actionview (= 8.0.2)
212
- activejob (= 8.0.2)
213
- activemodel (= 8.0.2)
214
- activerecord (= 8.0.2)
215
- activestorage (= 8.0.2)
216
- activesupport (= 8.0.2)
217
- bundler (>= 1.15.0)
218
- railties (= 8.0.2)
219
- rails-dom-testing (2.2.0)
220
- activesupport (>= 5.0.0)
221
- minitest
222
- nokogiri (>= 1.6)
223
- rails-html-sanitizer (1.6.2)
224
- loofah (~> 2.21)
225
- nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
226
- railties (8.0.2)
227
- actionpack (= 8.0.2)
228
- activesupport (= 8.0.2)
229
- irb (~> 1.13)
230
- rackup (>= 1.0.0)
231
- rake (>= 12.2)
232
- thor (~> 1.0, >= 1.2.2)
233
- zeitwerk (~> 2.6)
234
- rainbow (3.1.1)
235
- rake (13.2.1)
236
- rdoc (6.12.0)
237
- psych (>= 4.0.0)
238
- redis (1.0.7)
239
- redis-client (0.24.0)
240
- connection_pool
241
- redis-namespace (0.4.4)
242
- redis (~> 1.0.0)
243
- regexp_parser (2.10.0)
244
- reline (0.6.0)
245
- io-console (~> 0.5)
246
- resque (1.8.5)
247
- redis (~> 1.0.0)
248
- redis-namespace (~> 0.4.0)
249
- sinatra (>= 0.9.2)
250
- vegas (~> 0.1.2)
251
- rubocop (1.73.2)
252
- json (~> 2.3)
253
- language_server-protocol (~> 3.17.0.2)
254
- lint_roller (~> 1.1.0)
255
- parallel (~> 1.10)
256
- parser (>= 3.3.0.2)
257
- rainbow (>= 2.2.2, < 4.0)
258
- regexp_parser (>= 2.9.3, < 3.0)
259
- rubocop-ast (>= 1.38.0, < 2.0)
260
- ruby-progressbar (~> 1.7)
261
- unicode-display_width (>= 2.4.0, < 4.0)
262
- rubocop-ast (1.41.0)
263
- parser (>= 3.3.7.2)
264
- rubocop-performance (1.24.0)
265
- lint_roller (~> 1.1)
266
- rubocop (>= 1.72.1, < 2.0)
267
- rubocop-ast (>= 1.38.0, < 2.0)
268
- ruby-progressbar (1.13.0)
269
- ruby2_keywords (0.0.5)
270
- securerandom (0.4.1)
271
- sidekiq (8.0.1)
272
- connection_pool (>= 2.5.0)
273
- json (>= 2.9.0)
274
- logger (>= 1.6.2)
275
- rack (>= 3.1.0)
276
- redis-client (>= 0.23.2)
277
- sinatra (4.1.1)
278
- logger (>= 1.6.0)
279
- mustermann (~> 3.0)
280
- rack (>= 3.0.0, < 4)
281
- rack-protection (= 4.1.1)
282
- rack-session (>= 2.0.0, < 3)
283
- tilt (~> 2.0)
284
- slack-notifier (2.4.0)
285
- standard (1.47.0)
286
- language_server-protocol (~> 3.17.0.2)
287
- lint_roller (~> 1.0)
288
- rubocop (~> 1.73.0)
289
- standard-custom (~> 1.0.0)
290
- standard-performance (~> 1.7)
291
- standard-custom (1.0.2)
292
- lint_roller (~> 1.0)
293
- rubocop (~> 1.50)
294
- standard-performance (1.7.0)
295
- lint_roller (~> 1.1)
296
- rubocop-performance (~> 1.24.0)
297
- stringio (3.1.5)
298
- thor (1.3.2)
299
- tilt (2.6.0)
300
- timecop (0.9.10)
301
- timeout (0.4.3)
302
- tzinfo (2.0.6)
303
- concurrent-ruby (~> 1.0)
304
- unicode-display_width (3.1.4)
305
- unicode-emoji (~> 4.0, >= 4.0.4)
306
- unicode-emoji (4.0.4)
307
- uri (1.0.3)
308
- useragent (0.16.11)
309
- vegas (0.1.11)
310
- rack (>= 1.0.0)
311
- websocket-driver (0.7.7)
312
- base64
313
- websocket-extensions (>= 0.1.0)
314
- websocket-extensions (0.1.5)
315
- zeitwerk (2.7.2)
316
-
317
- PLATFORMS
318
- aarch64-linux-gnu
319
- aarch64-linux-musl
320
- arm-linux-gnu
321
- arm-linux-musl
322
- arm64-darwin
323
- x86_64-darwin
324
- x86_64-linux-gnu
325
- x86_64-linux-musl
326
-
327
- DEPENDENCIES
328
- aws-sdk-sns (~> 1)
329
- carrier-pigeon (>= 0.7.0)
330
- dogapi (>= 1.23.0)
331
- exception_notification!
332
- hipchat (>= 1.0.0)
333
- httparty (~> 0.10.2)
334
- mocha (>= 0.13.0)
335
- mock_redis (~> 0.19.0)
336
- net-smtp
337
- ostruct
338
- rails (>= 7.1, < 9)
339
- resque (~> 1.8.0)
340
- sidekiq (>= 5.0.4)
341
- slack-notifier (>= 1.0.0)
342
- standard
343
- timecop (~> 0.9.0)
344
-
345
- BUNDLED WITH
346
- 2.6.6
@@ -1,8 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "rails", "~> 8.0.0"
4
-
5
- # Include any dependencies here that need to be specifically tested.
6
- gem "sidekiq", "7.1.0" # >= 7.1.5 for the conditional in sidekiq.rb to check parameter cardinality
7
-
8
- gemspec path: "../"
@@ -1,5 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "rails", "~> 7.1.0"
4
-
5
- gemspec path: "../"
@@ -1,5 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "rails", "~> 7.2.0"
4
-
5
- gemspec path: "../"
@@ -1,5 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "rails", "~> 8.0.0"
4
-
5
- gemspec path: "../"
@@ -1,106 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "test_helper"
4
-
5
- class RackTest < ActiveSupport::TestCase
6
- setup do
7
- @pass_app = Object.new
8
- @pass_app.stubs(:call).returns([nil, {"X-Cascade" => "pass"}, nil])
9
-
10
- @normal_app = Object.new
11
- @normal_app.stubs(:call).returns([nil, {}, nil])
12
- end
13
-
14
- teardown do
15
- ExceptionNotifier.reset_notifiers!
16
- end
17
-
18
- test 'should ignore "X-Cascade" header by default' do
19
- ExceptionNotifier.expects(:notify_exception).never
20
- ExceptionNotification::Rack.new(@pass_app).call({})
21
- end
22
-
23
- test 'should notify on "X-Cascade" = "pass" if ignore_cascade_pass option is false' do
24
- ExceptionNotifier.expects(:notify_exception).once
25
- ExceptionNotification::Rack.new(@pass_app, ignore_cascade_pass: false).call({})
26
- end
27
-
28
- test "should assign error_grouping if error_grouping is specified" do
29
- refute ExceptionNotifier.error_grouping
30
- ExceptionNotification::Rack.new(@normal_app, error_grouping: true).call({})
31
- assert ExceptionNotifier.error_grouping
32
- end
33
-
34
- test "should assign notification_trigger if notification_trigger is specified" do
35
- assert_nil ExceptionNotifier.notification_trigger
36
- ExceptionNotification::Rack.new(@normal_app, notification_trigger: ->(_i) { true }).call({})
37
- assert_respond_to ExceptionNotifier.notification_trigger, :call
38
- end
39
-
40
- if defined?(Rails) && Rails.respond_to?(:cache)
41
- test "should set default cache to Rails cache" do
42
- ExceptionNotification::Rack.new(@normal_app, error_grouping: true).call({})
43
- assert_equal Rails.cache, ExceptionNotifier.error_grouping_cache
44
- end
45
- end
46
-
47
- test "should ignore exceptions with Usar Agent in ignore_crawlers" do
48
- exception_app = Object.new
49
- exception_app.stubs(:call).raises(RuntimeError)
50
-
51
- env = {"HTTP_USER_AGENT" => "Mozilla/5.0 (compatible; Crawlerbot/2.1;)"}
52
-
53
- begin
54
- ExceptionNotification::Rack.new(exception_app, ignore_crawlers: %w[Crawlerbot]).call(env)
55
-
56
- flunk
57
- rescue
58
- refute env["exception_notifier.delivered"]
59
- end
60
- end
61
-
62
- test "should ignore exceptions if ignore_if condition is met" do
63
- exception_app = Object.new
64
- exception_app.stubs(:call).raises(RuntimeError)
65
-
66
- env = {}
67
-
68
- begin
69
- ExceptionNotification::Rack.new(
70
- exception_app,
71
- ignore_if: ->(_env, exception) { exception.is_a? RuntimeError }
72
- ).call(env)
73
-
74
- flunk
75
- rescue
76
- refute env["exception_notifier.delivered"]
77
- end
78
- end
79
-
80
- test "should ignore exceptions with notifiers that satisfies ignore_notifier_if condition" do
81
- exception_app = Object.new
82
- exception_app.stubs(:call).raises(RuntimeError)
83
-
84
- notifier1_called = notifier2_called = false
85
- notifier1 = ->(_exception, _options) { notifier1_called = true }
86
- notifier2 = ->(_exception, _options) { notifier2_called = true }
87
-
88
- env = {}
89
-
90
- begin
91
- ExceptionNotification::Rack.new(
92
- exception_app,
93
- ignore_notifier_if: {
94
- notifier1: ->(_env, exception) { exception.is_a? RuntimeError }
95
- },
96
- notifier1: notifier1,
97
- notifier2: notifier2
98
- ).call(env)
99
-
100
- flunk
101
- rescue
102
- refute notifier1_called
103
- assert notifier2_called
104
- end
105
- end
106
- end
@@ -1,38 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "test_helper"
4
-
5
- require "rake"
6
- require "exception_notification/rake"
7
-
8
- class RakeTest < ActiveSupport::TestCase
9
- setup do
10
- Rake::Task.define_task :dependency_1 do
11
- nil # noop but could puts for debugging
12
- end
13
- Rake::Task.define_task raise_exception: :dependency_1 do
14
- raise "test exception"
15
- end
16
- @task = Rake::Task[:raise_exception]
17
- end
18
-
19
- test "notifies of exception" do
20
- ExceptionNotifier.expects(:notify_exception).with do |ex, opts|
21
- data = opts[:data]
22
- ex.is_a?(RuntimeError) &&
23
- ex.message == "test exception" &&
24
- data[:error_class] == "RuntimeError" &&
25
- data[:error_message] == "test exception" &&
26
- data[:rake][:rake_command_line] == "rake " &&
27
- data[:rake][:name] == "raise_exception" &&
28
- data[:rake][:timestamp] &&
29
- data[:rake][:sources] == ["dependency_1"] &&
30
- data[:rake][:prerequisite_tasks][0][:name] == "dependency_1"
31
- end
32
-
33
- # The original error is re-raised
34
- assert_raises(RuntimeError) do
35
- @task.invoke
36
- end
37
- end
38
- end