25 lines
809 B
Elixir
25 lines
809 B
Elixir
## This Source Code Form is subject to the terms of the Mozilla Public
|
|
## License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
## file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
##
|
|
## Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved.
|
|
|
|
|
|
defmodule VersionCommandTest do
|
|
use ExUnit.Case
|
|
|
|
@command RabbitMQ.CLI.Ctl.Commands.VersionCommand
|
|
|
|
test "merge_defaults: merges no defaults" do
|
|
assert @command.merge_defaults([], %{}) == {[], %{}}
|
|
end
|
|
|
|
test "validate: treats positional arguments as a failure" do
|
|
assert @command.validate(["extra-arg"], %{}) == {:validation_failure, :too_many_args}
|
|
end
|
|
|
|
test "validate: treats empty positional arguments and default switches as a success" do
|
|
assert @command.validate([], %{}) == :ok
|
|
end
|
|
end
|