Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: ensure parse_argv/1 can be overridden #167

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading