Packages

An Elixir library to make function delegation testable.

Current section

7 Versions

Jump to

Compare versions

5 files changed
+9 additions
-3 deletions
  @@ -19,7 +19,7 @@ by adding `delx` to your list of dependencies in `mix.exs`:
19 19 ```elixir
20 20 def deps do
21 21 [
22 - {:delx, "~> 2.1.0"}
22 + {:delx, "~> 2.1"}
23 23 ]
24 24 end
25 25 ```
  @@ -15,4 +15,4 @@
15 15 [{<<"GitHub">>,<<"https://github.com/i22-digitalagentur/delx">>}]}.
16 16 {<<"name">>,<<"delx">>}.
17 17 {<<"requirements">>,[]}.
18 - {<<"version">>,<<"2.1.0">>}.
18 + {<<"version">>,<<"2.1.1">>}.
  @@ -28,6 +28,10 @@ defmodule Delx.Defdel do
28 28 for fun <- List.wrap(funs) do
29 29 {name, args, as, as_args} = Kernel.Utils.defdelegate(fun, opts)
30 30
31 + # Dialyzer may possibly complain about "No local return". So we tell him
32 + # to stop as we're only delegating here.
33 + @dialyzer {:nowarn_function, [{name, length(as_args)}]}
34 +
31 35 @doc delegate_to: {target, as, length(as_args)}
32 36 def unquote(name)(unquote_splicing(args)) do
33 37 @delegator.apply(
  @@ -129,6 +129,8 @@ defmodule Delx.TestAssertions do
129 129 end
130 130 end
131 131
132 + defp stub_args(0), do: []
133 +
132 134 defp stub_args(arity) do
133 135 Enum.map(1..arity, &{:arg_stub, &1})
134 136 end
  @@ -4,7 +4,7 @@ defmodule Delx.MixProject do
4 4 def project do
5 5 [
6 6 app: :delx,
7 - version: "2.1.0",
7 + version: "2.1.1",
8 8 elixir: "~> 1.8",
9 9 start_permanent: Mix.env() == :prod,
10 10 description: description(),