Skip to content

Commit

Permalink
change notification_trigger occurrences to count
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquinco committed Sep 19, 2024
1 parent bd9f657 commit 2d8eb8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/unit/error_storage_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ defmodule ErrorStorageTest do
}
end

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

ErrorStorage.reset_accumulated_errors(:always, @error_info)
Expand Down
10 changes: 5 additions & 5 deletions test/unit/notifier_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ defmodule NotifierTest do
defmodule PlugErrorWithExponentialTriggerNotifier do
use BoomNotifier,
notifier: FakeNotifier,
notification_trigger: :exponential,
count: :exponential,
options: [
subject: "BOOM error caught",
sender_pid_name: TestMessageProxy
Expand All @@ -132,7 +132,7 @@ defmodule NotifierTest do
defmodule PlugErrorWithExponentialTriggerWithLimitNotifier do
use BoomNotifier,
notifier: FakeNotifier,
notification_trigger: [exponential: [limit: 3]],
count: [exponential: [limit: 3]],
options: [
subject: "BOOM error caught",
sender_pid_name: TestMessageProxy
Expand Down Expand Up @@ -229,7 +229,7 @@ defmodule NotifierTest do
assert_receive(%{exception: %{subject: "BOOM error caught: thrown error"}}, @receive_timeout)
end

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

catch_error(PlugErrorWithExponentialTriggerNotifier.call(conn, []))
Expand All @@ -243,7 +243,7 @@ defmodule NotifierTest do
assert exceptions == 0
end

test "reports exception in groups when :notification_trigger setting is :exponential with limit" do
test "reports exception in groups when :count setting is :exponential with limit" do
conn = conn(:get, "/")

catch_error(PlugErrorWithExponentialTriggerWithLimitNotifier.call(conn, []))
Expand All @@ -267,7 +267,7 @@ defmodule NotifierTest do
assert exceptions == 0
end

test "reports every exception when :notification_trigger setting is not set" do
test "reports every exception when :count setting is not set" do
conn = conn(:get, "/")

catch_error(PlugErrorWithSingleNotifier.call(conn, []))
Expand Down

0 comments on commit 2d8eb8f

Please sign in to comment.