Skip to content

Commit

Permalink
Fixing warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nsomar committed Feb 27, 2017
1 parent 573bfb7 commit 64b10d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/ex_stub_assert.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ defmodule ExStub.Assert do
{{:., _, [module, function]}, _, params} = call
mod_name = module_name_from_ast(module)

assert_call_macro(module, function, params)
assert_call_macro(mod_name, function, params)
end

defp assert_call_macro(mod_name, func_name, params) do
Expand All @@ -63,6 +63,5 @@ defmodule ExStub.Assert do
end

defp module_name_from_ast(ast_module_name), do: Code.eval_quoted(ast_module_name) |> elem(0)
defp function_name({name, _, _}), do: name

end
4 changes: 2 additions & 2 deletions lib/ex_stub_utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ defmodule ExStub.Utils do
|> elem(1)
end

defp replace_params_in_func({:def, line, [{func_name, func_line, params}, body]}, new_params) do
defp replace_params_in_func({:def, line, [{func_name, func_line, _}, body]}, new_params) do
{:def, line, [{func_name, func_line, new_params}, body]}
end

defp replace_body_in_func({:def, line, [func_def, body]}, new_body) do
defp replace_body_in_func({:def, line, [func_def, _]}, new_body) do
{:def, line, [func_def, new_body]}
end

Expand Down

0 comments on commit 64b10d6

Please sign in to comment.