Skip to content

Commit c328922

Browse files
committed
CLI: Fix match of discover peers command test
This previously emitted a warning because Elixir will rebind `this_node` by default, so the `this_node` binding in the line above was unused. (As opposed to Erlang which would treat this as a match - rejecting the binding if `this_node` was not equal to the value being matched.) The node needed to be adjusted as well - `node()` returned the ExUnit runner's node while the command returned the remote node, which is stored in the context under `opts.node`.
1 parent d58d874 commit c328922

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

deps/rabbitmq_cli/test/diagnostics/discover_peers_command_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ defmodule DiscoverPeersCommandTest do
3737

3838
@tag test_timeout: 15000
3939
test "run: returns a list of nodes when the backend isn't configured", context do
40-
this_node = node()
41-
assert match?({:ok, {[this_node], _}}, @command.run([], context[:opts]))
40+
this_node = context.opts.node
41+
assert match?({:ok, {[^this_node], _}}, @command.run([], context[:opts]))
4242
end
4343
end

0 commit comments

Comments
 (0)