Skip to content

Commit

Permalink
Run the formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
intentionally-left-nil committed Jun 30, 2018
1 parent a527f68 commit 2bbc6b8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
1 change: 0 additions & 1 deletion lib/cli/commands/outdated.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ defmodule Wand.CLI.Commands.Outdated do

def help(_type), do: Display.print(@moduledoc)


def validate(["outdated"]), do: {:ok, []}
def validate(_args), do: {:error, :wrong_command}

Expand Down
1 change: 1 addition & 0 deletions test/commands/outdated_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ defmodule OutdatedTest do

describe "execute" do
setup :verify_on_exit!

test "outsources to hex.outdated" do
Helpers.System.stub_outdated()
assert Outdated.execute([]) == :ok
Expand Down
20 changes: 10 additions & 10 deletions test/support/system.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@ defmodule Wand.Test.Helpers.System do

def stub_update_deps() do
message = "Resolving Hex dependencies"
expect(Wand.SystemMock, :cmd, fn("mix", ["deps.get"], _opts) -> {message, 0} end)
expect(Wand.SystemMock, :cmd, fn "mix", ["deps.get"], _opts -> {message, 0} end)
end

def stub_failed_update_deps() do
message =
"Could not find a Mix.Project, please ensure you are running Mix in a directory with a mix.exs file"

expect(Wand.SystemMock, :cmd, fn("mix", ["deps.get"], _opts) -> {message, 1} end)
expect(Wand.SystemMock, :cmd, fn "mix", ["deps.get"], _opts -> {message, 1} end)
end

def stub_compile() do
message = "===> Compiling parse_trans"
expect(Wand.SystemMock, :cmd, fn("mix", ["deps.compile"], _opts) -> {message, 0} end)
expect(Wand.SystemMock, :cmd, fn "mix", ["deps.compile"], _opts -> {message, 0} end)
end

def stub_failed_compile() do
message = "** (SyntaxError) mix.exs:9"
expect(Wand.SystemMock, :cmd, fn("mix", ["deps.compile"], _opts) -> {message, 1} end)
expect(Wand.SystemMock, :cmd, fn "mix", ["deps.compile"], _opts -> {message, 1} end)
end

def stub_cleanup_deps() do
expect(Wand.SystemMock, :cmd, fn("mix", ["deps.unlock", "--unused"], _opts) -> {"", 0} end)
expect(Wand.SystemMock, :cmd, fn "mix", ["deps.unlock", "--unused"], _opts -> {"", 0} end)
end

def stub_failed_cleanup_deps() do
message = "** (CompileError) mix.lock:2"

expect(Wand.SystemMock, :cmd, fn("mix", ["deps.unlock", "--unused"], _opts) -> {message, 1} end)
expect(Wand.SystemMock, :cmd, fn "mix", ["deps.unlock", "--unused"], _opts -> {message, 1} end)
end

def stub_get_deps() do
Expand All @@ -45,23 +45,23 @@ defmodule Wand.Test.Helpers.System do
def stub_get_deps(deps) do
message = WandCore.Poison.encode!(deps)

expect(Wand.SystemMock, :cmd, fn("mix", ["wand_core.get_deps"], _opts) -> {message, 0} end)
expect(Wand.SystemMock, :cmd, fn "mix", ["wand_core.get_deps"], _opts -> {message, 0} end)
end

def stub_failed_get_deps() do
expect(Wand.SystemMock, :cmd, fn("mix", ["wand_core.get_deps"], _opts) -> {"", 1} end)
expect(Wand.SystemMock, :cmd, fn "mix", ["wand_core.get_deps"], _opts -> {"", 1} end)
end

def stub_get_bad_deps() do
message =
[["mox", "~> 0.3.2", [["only", "test"]]], ["oops", "ex_doc", ">= 0.0.0", [["only", "dev"]]]]
|> WandCore.Poison.encode!()

expect(Wand.SystemMock, :cmd, fn("mix", ["wand_core.get_deps"], _opts) -> {message, 0} end)
expect(Wand.SystemMock, :cmd, fn "mix", ["wand_core.get_deps"], _opts -> {message, 0} end)
end

def stub_outdated() do
message = "A green version"
expect(Wand.SystemMock, :cmd, fn("mix", ["hex.outdated"], _opts) -> {message, 0} end)
expect(Wand.SystemMock, :cmd, fn "mix", ["hex.outdated"], _opts -> {message, 0} end)
end
end

0 comments on commit 2bbc6b8

Please sign in to comment.