       defmodule MyModule do
         var_out1 = 1
         case var_out1 do
-          _ ->
+          {var_on} ->
             var_in = 1
             IO.puts ""
         end

    assert get_line_vars(acc, 4) == [:var]
  end

  test "functions of arity 0 should not be in the vars list" do

    {_ast, acc} =
      """
      defmodule MyModule do
        myself = self
        mynode = node()
        IO.puts ""
      end
      """
      |> Code.string_to_quoted
      |> MetadataBuilder.build

    assert get_line_vars(acc, 3) == [:mynode, :myself]
  end

  defp get_line_vars(acc, line) do
    (get_in(acc.lines_to_env, [line, :vars]) || []) |> Enum.sort
  end

  defp get_subject_definition_line(module, func, arity) do
    file = module.module_info(:compile)[:source]
    {_ast, acc} =

      |> Code.string_to_quoted
      |> MetadataBuilder.build

    assert get_line_vars(acc, 6) == [:var_in, :var_on, :var_out1]
    # This assert fails
    # assert get_line_vars(acc, 9) == [:var_in, :var_out1, :var_out2]
  end

  test "vars defined inside a `cond`" do
