Packages

A configurable mix task to watch file changes Watch file changes in a project and run the corresponding command when a change happens.

Current section

Files

Jump to
eye_drops lib commands commands_test.exs
Raw

lib/commands/commands_test.exs

defmodule EyeDrops.CommandsTest do
use ExUnit.Case
alias EyeDrops.Commands
test "Get specified task to watch" do
result = Commands.parse(["--include-tasks", "unit_tests"])
assert result == {:ok, %{include_tasks: [:unit_tests] }}
end
test "Get specified comma separated list of tasks to watch" do
result = Commands.parse(["--include-tasks", "unit_tests,acceptance,integration"])
assert result == {:ok, %{include_tasks: [:unit_tests, :acceptance, :integration]}}
end
test "Use of invalid switch" do
assert_raise SwitchError, "Invalid parameter --not-valid", fn ->
Commands.parse(["--not-valid", "unit_tests"])
end
end
test "No switches passed" do
result = Commands.parse([])
assert result == {:ok, %{}}
end
end