We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5a6dcd7 commit 3324333Copy full SHA for 3324333
test/support/image_test_case.ex
@@ -1,16 +1,19 @@
1
defmodule ImageTestCase do
2
@moduledoc false
3
- use ExUnit.CaseTemplate, async: true
+
4
+ defmacro __using__(opts) do
5
+ quote do
6
+ use ExUnit.Case, async: async?
7
8
+ import ImageTestCase
9
10
+ async? = Keyword.get(unquote(opts), :async, true)
11
+ end
12
13
14
@doc "Reads an image giving a relative path to test/fixtures/images"
15
def read_image(rel_path) do
16
abs_path = Path.expand(Path.join("test/fixtures/images", rel_path), File.cwd!())
17
File.read!(abs_path)
18
end
-
- using do
- quote do
- def read_image(rel_path), do: ImageTestCase.read_image(rel_path)
- end
19
0 commit comments