Add `mix hex.user whoami`

This PR adds the mix task `mix hex.user whoami` which simply prints the authenticated users username.

Tests included :smile:

:dancer:
I tried this originally but I could only get capture_io to work with Mix.Shell.IO.info.

As it seems this was not the right way to test this (I could not see any example), what is the right way to test it?


-- 
James Spencer
Sent via Airmail for Mac

On 18 August 2014 at 8:02:44 pm, Eric Meadows-Jönsson (notifications@github.com) wrote:

In lib/mix/tasks/hex/user.ex:

> @@ -44,6 +51,13 @@ defmodule Mix.Tasks.Hex.User do
>      end
>    end
>   
> +  defp whoami?(opts) do
> +    case Keyword.fetch(Hex.Util.read_config, :username) do
> +       {:ok, value} -> Mix.Shell.IO.info(value)
This should be printed with Mix.shell.info(value) so we can test the output without capture_io there are examples in other tests.

—
Reply to this email directly or view it on GitHub.