   end
 
   setup_all do
-    valid_email = Swoosh.Email.new(
-      from: "tony.stark@example.com",
-      to: "steve.rogers@example.com",
-      subject: "Hello, Avengers!",
-      html_body: "<h1>Hello</h1>",
-      text_body: "Hello"
-    )
+    valid_email =
+      Swoosh.Email.new(
+        from: "tony.stark@example.com",
+        to: "steve.rogers@example.com",
+        subject: "Hello, Avengers!",
+        html_body: "<h1>Hello</h1>",
+        text_body: "Hello"
+      )
+
     {:ok, valid_email: valid_email}
   end
 

    {:ok, {_email, configs}} = EnvMailer.deliver(email)

    assert MapSet.subset?(
      MapSet.new([
        username: "userenv",
        password: "passwordenv",
        relay: "smtp.sendgrid.net",
        tls: :always
      ]),
      MapSet.new(configs)
    )
  end

  test "merge config passed to deliver/2 into Mailer's config", %{valid_email: email} do

    assert {:ok, _} = OtherAdapterMailer.deliver(email, adapter: FakeAdapter)
  end

  test "raise if mailer defined with nonexistent adapter", %{valid_email: email} do
    import ExUnit.CaptureLog

    assert capture_log(fn ->
             defmodule WontWorkAdapterMailer do
               use Swoosh.Mailer, otp_app: :swoosh, adapter: NotExistAdapter
             end
           end) =~ ~r/Elixir.NotExistAdapter does not exist/

    assert_raise UndefinedFunctionError, fn ->
      WontWorkAdapterMailer.deliver(email)
    end
  end

