Skip to content

Commit

Permalink
Fixes typos and changes assert email timeout to 100ms
Browse files Browse the repository at this point in the history
  • Loading branch information
jbernardo95 committed Dec 9, 2016
1 parent ab77c26 commit d97d808
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/bamboo/test.ex
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ defmodule Bamboo.Test do
Checks whether an email was delivered.
Must be used with the `Bamboo.TestAdapter` or this will never pass. In case you
are delivering from another process, the assertion waits up to 150ms before
are delivering from another process, the assertion waits up to 100ms before
failing. Typically if an email is successfully delivered the assertion will
pass instantly, so test suites will remain fast.
Expand All @@ -161,15 +161,15 @@ defmodule Bamboo.Test do
quote do
import ExUnit.Assertions
email = Bamboo.Test.normalize_for_testing(unquote(email))
assert_receive({:delivered_email, ^email}, 150, Bamboo.Test.flunk_with_email_list(email))
assert_receive({:delivered_email, ^email}, 100, Bamboo.Test.flunk_with_email_list(email))
end
end

@doc """
Checks whether an email its params equal to the ones provided.
Check whether an email's params are equal to the ones provided.
Must be used with the `Bamboo.TestAdapter` or this will never pass. In case you
are delivering from another process, the assertion waits up to 150ms before
are delivering from another process, the assertion waits up to 100ms before
failing. Typically if an email is successfully delivered the assertion will
pass instantly, so test suites will remain fast.
Expand All @@ -185,7 +185,7 @@ defmodule Bamboo.Test do
defmacro assert_delivered_with(email_params) do
quote bind_quoted: [email_params: email_params] do
import ExUnit.Assertions
assert_receive({:delivered_email, email}, 150, Bamboo.Test.flunk_no_emails_received)
assert_receive({:delivered_email, email}, 100, Bamboo.Test.flunk_no_emails_received)

recieved_email_params = email |> Map.from_struct
assert Enum.all?(email_params, fn({k, v}) -> recieved_email_params[k] == v end),
Expand Down
4 changes: 2 additions & 2 deletions test/lib/bamboo/adapters/test_adapter_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ defmodule Bamboo.TestAdapterTest do
error in [ExUnit.AssertionError] ->
assert error.message =~ "0 emails delivered"
else
_ -> flunk "assert_delivered_email should failed"
_ -> flunk "assert_delivered_email should have failed"
end
end

Expand All @@ -137,7 +137,7 @@ defmodule Bamboo.TestAdapterTest do
assert error.message =~ "do not match"
assert error.message =~ sent_email.from
else
_ -> flunk "assert_delivered_email should failed"
_ -> flunk "assert_delivered_email should have failed"
end
end

Expand Down

0 comments on commit d97d808

Please sign in to comment.