Skip to content

Commit 51cfb59

Browse files
committed
change notification_trigger occurrences to count
Fix test that was not detecting this
1 parent 9affdd3 commit 51cfb59

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

test/unit/error_storage_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ defmodule ErrorStorageTest do
226226
}
227227
end
228228

229-
test "does not increase the counter when notification_trigger is :always" do
229+
test "does not increase the counter when count is :always" do
230230
ErrorStorage.accumulate(@error_info)
231231

232232
ErrorStorage.reset_stats(@error_info, :always)

test/unit/notifier_test.exs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ defmodule NotifierTest do
118118
defmodule PlugErrorWithExponentialTriggerNotifier do
119119
use BoomNotifier,
120120
notifier: FakeNotifier,
121-
notification_trigger: :exponential,
121+
count: :exponential,
122122
options: [
123123
subject: "BOOM error caught",
124124
sender_pid_name: TestMessageProxy
@@ -132,7 +132,7 @@ defmodule NotifierTest do
132132
defmodule PlugErrorWithExponentialTriggerWithLimitNotifier do
133133
use BoomNotifier,
134134
notifier: FakeNotifier,
135-
notification_trigger: [exponential: [limit: 3]],
135+
count: [exponential: [limit: 3]],
136136
options: [
137137
subject: "BOOM error caught",
138138
sender_pid_name: TestMessageProxy
@@ -229,7 +229,7 @@ defmodule NotifierTest do
229229
assert_receive(%{exception: %{subject: "BOOM error caught: thrown error"}}, @receive_timeout)
230230
end
231231

232-
test "reports exception in groups when :notification_trigger setting is :exponential" do
232+
test "reports exception in groups when :count setting is :exponential" do
233233
conn = conn(:get, "/")
234234

235235
catch_error(PlugErrorWithExponentialTriggerNotifier.call(conn, []))
@@ -239,11 +239,10 @@ defmodule NotifierTest do
239239
catch_error(PlugErrorWithExponentialTriggerNotifier.call(conn, []))
240240
assert_receive(%{exception: _}, @receive_timeout)
241241

242-
{:message_queue_len, exceptions} = Process.info(self(), :message_queue_len)
243-
assert exceptions == 0
242+
refute_receive(%{exception: _}, @receive_timeout)
244243
end
245244

246-
test "reports exception in groups when :notification_trigger setting is :exponential with limit" do
245+
test "reports exception in groups when :count setting is :exponential with limit" do
247246
conn = conn(:get, "/")
248247

249248
catch_error(PlugErrorWithExponentialTriggerWithLimitNotifier.call(conn, []))
@@ -263,11 +262,10 @@ defmodule NotifierTest do
263262
catch_error(PlugErrorWithExponentialTriggerWithLimitNotifier.call(conn, []))
264263
assert_receive(%{exception: _}, @receive_timeout)
265264

266-
{:message_queue_len, exceptions} = Process.info(self(), :message_queue_len)
267-
assert exceptions == 0
265+
refute_receive(%{exception: _}, @receive_timeout)
268266
end
269267

270-
test "reports every exception when :notification_trigger setting is not set" do
268+
test "reports every exception when :count setting is not set" do
271269
conn = conn(:get, "/")
272270

273271
catch_error(PlugErrorWithSingleNotifier.call(conn, []))

0 commit comments

Comments
 (0)