   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
 

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

  if Version.match?(System.version(), "~> 1.5") do
    # TODO: Remove version guard when dropping Elixir 1.4 support
    # Elixir < 1.5 raises an unexpected error when on_load fails
    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
  end


    assert_raise DeliveryError, "delivery error: expected \"from\" to be set", fn ->
      Map.put(valid_email, :from, nil) |> FakeMailer.deliver!()
    end

    assert_raise DeliveryError, "delivery error: expected \"from\" to be set", fn ->
      Map.put(valid_email, :from, {"Name", nil}) |> FakeMailer.deliver!()
    end

    assert_raise DeliveryError, "delivery error: expected \"from\" to be set", fn ->
      Map.put(valid_email, :from, {"Name", ""}) |> FakeMailer.deliver!()
    end
