-
-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refacor(elixir): automatic start_link for backword-compatibility
- Loading branch information
Showing
3 changed files
with
26 additions
and
4 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
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
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 |
---|---|---|
|
@@ -25,7 +25,6 @@ defmodule MailCheckerTest do | |
end | ||
|
||
test "should return true if the email is valid" do | ||
{:ok, _pid} = MailChecker.start_link() # FIXME: This is a breaking change :( | ||
assert_valid("[email protected]") | ||
assert_valid("[email protected]") | ||
assert_valid("[email protected]") | ||
|
@@ -48,15 +47,13 @@ defmodule MailCheckerTest do | |
end | ||
|
||
test "should return false if the email come from a throwable domain" do | ||
{:ok, _pid} = MailChecker.start_link() # FIXME: This is a breaking change :( | ||
assert_invalid("[email protected]") | ||
assert_invalid("[email protected]") | ||
assert_invalid("[email protected]") | ||
assert_invalid("[email protected]") | ||
end | ||
|
||
test "should return false if the email is from a blacklisted domain" do | ||
{:ok, _pid} = MailChecker.start_link() # FIXME: This is a breaking change :( | ||
Enum.each(MailChecker.blacklist, fn domain -> | ||
assert_invalid("test@" <> domain) | ||
assert_invalid("test@subdomain." <> domain) | ||
|
@@ -65,7 +62,6 @@ defmodule MailCheckerTest do | |
end | ||
|
||
test "should return false if the email is from a custom domain" do | ||
{:ok, _pid} = MailChecker.start_link() | ||
assert_valid("[email protected]") | ||
assert_valid("[email protected]") | ||
assert_valid("[email protected]") | ||
|
@@ -75,5 +71,9 @@ defmodule MailCheckerTest do | |
assert_invalid("[email protected]") | ||
assert_invalid("[email protected]") | ||
assert_valid("[email protected]") | ||
|
||
MailChecker.add_custom_domains(["gmail.com"]) | ||
|
||
assert_invalid("[email protected]") | ||
end | ||
end |