title: Elixir - Basic supervisor setup crashes instead of restarting the child process
body: <p>Ignoring the absence of the Mix config file, I write the following:</p>
  
  <pre><code>defmodule Test.Supervisor do
      use Supervisor
  
      def start_link do
        #"name:" will show up in :observer...
          Supervisor.start_link(__MODULE__, [], [name: :"root_supervisor"])
      end
  
      def init(args) do
          children = [
              worker(Test.Method, [], [function: :start, id: "my_root_process"]),
          ]
  
          supervise(children, [strategy: :one_for_one, name: :root])
      end
  end
  
  defmodule Test do
      def start(_type, _args) do
          Test.Supervisor.start_link()
      end
  end
  
  defmodule Test.Method do
      def start do
          IO.puts("Expect to see me often... #{self}")
      end
  end
  </code></pre>
  
  <p>Which crashes after the first run (iex -S mix) without restarting the application. The error message is:</p>
  
  <pre><code>=INFO REPORT==== 14-Jan-2016::22:34:04 ===
      application: logger
      exited: stopped
      type: temporary
  ** (Mix) Could not start application mememe: Test.start(:normal, {}) returned
  an error: shutdown: failed to start child: "my_root_process"
      ** (EXIT) :ok
  </code></pre>
  
  <p>If however, I change <code>Test.start()</code> to call <code>Test.Method.start()</code> directly, like so:</p>
  
  <pre><code>defmodule Test do
      def start(_type, _args) do
          Test.Method.start()
      end
  end
  </code></pre>
  
  <p>Then it runs fine, but then the code won't be supervised.
  I'm quite sure I'm making an elementary mistake either in implementation, or comprehension here, but what is that mistake exactly? </p>