Skip to content

Commit

Permalink
test: ensure parse_argv/1 can be overridden
Browse files Browse the repository at this point in the history
  • Loading branch information
zachallaun committed Dec 10, 2024
1 parent 41d8368 commit 57f978c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/igniter/mix/task_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,29 @@ defmodule Igniter.Mix.TaskTest do
end
end

describe "parse_argv/1" do
defmodule ExampleTaskWithOverridenParseArgv do
use Igniter.Mix.Task

def parse_argv(_argv) do
%Igniter.Mix.Task.Args{
argv: :overridden
}
end

def igniter(igniter) do
send(self(), {:args, igniter.args})
igniter
end
end

test "can be overriden" do
ExampleTaskWithOverridenParseArgv.run([])

assert_received {:args, %Igniter.Mix.Task.Args{argv: :overridden}}
end
end

describe "igniter/2 deprecation" do
defp define_module do
original_opts = Code.compiler_options()
Expand Down

0 comments on commit 57f978c

Please sign in to comment.