This repository has been archived on 2023-08-07. You can view files and clone it, but cannot push or open issues or pull requests.
temple/test/support/utils.ex
Mitchell Hanberg 33c95186fb
Compile to EEx (#80)
Code is gross
2020-06-16 15:28:21 -04:00

22 lines
471 B
Elixir

defmodule Temple.Support.Utils do
defmacro __using__(_) do
quote do
import Kernel, except: [==: 2, =~: 2]
import unquote(__MODULE__)
end
end
def a == b when is_binary(a) and is_binary(b) do
a = String.replace(a, "\n", "")
b = String.replace(b, "\n", "")
Kernel.==(a, b)
end
def a =~ b when is_binary(a) and is_binary(b) do
a = String.replace(a, "\n", "")
b = String.replace(b, "\n", "")
Kernel.=~(a, b)
end
end