-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: don't capture more log than necessary
- Loading branch information
Showing
1 changed file
with
21 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ defmodule TowerEmailTest do | |
use ExUnit.Case | ||
doctest TowerEmail | ||
|
||
import ExUnit.CaptureLog, only: [capture_log: 1] | ||
|
||
setup do | ||
Application.put_env(:tower, :reporters, [TowerEmail.Reporter]) | ||
Application.put_env(:tower_email, :to, "[email protected]") | ||
|
@@ -13,10 +15,11 @@ defmodule TowerEmailTest do | |
end) | ||
end | ||
|
||
@tag capture_log: true | ||
test "reports arithmetic error" do | ||
in_unlinked_process(fn -> | ||
1 / 0 | ||
capture_log(fn -> | ||
in_unlinked_process(fn -> | ||
1 / 0 | ||
Check warning on line 21 in test/tower_email_test.exs GitHub Actions / main (1.15, 25.3.2.13, swoosh_1_15)
|
||
end) | ||
end) | ||
|
||
# TODO: Support waiting on assert_email_sent with a timeout | ||
|
@@ -34,21 +37,22 @@ defmodule TowerEmailTest do | |
) | ||
end | ||
|
||
@tag capture_log: true | ||
test "reports long match error" do | ||
in_unlinked_process(fn -> | ||
[eleven: "eleven"] = [ | ||
one: "one", | ||
two: "two", | ||
three: "three", | ||
four: "four", | ||
five: "five", | ||
six: "six", | ||
seven: "seven", | ||
eight: "eight", | ||
nine: "nine", | ||
ten: "ten" | ||
] | ||
capture_log(fn -> | ||
in_unlinked_process(fn -> | ||
[eleven: "eleven"] = [ | ||
Check warning on line 43 in test/tower_email_test.exs GitHub Actions / main (1.15, 25.3.2.13, swoosh_1_15)
|
||
one: "one", | ||
two: "two", | ||
three: "three", | ||
four: "four", | ||
five: "five", | ||
six: "six", | ||
seven: "seven", | ||
eight: "eight", | ||
nine: "nine", | ||
ten: "ten" | ||
] | ||
end) | ||
end) | ||
|
||
# TODO: Support waiting on assert_email_sent with a timeout | ||
|