Skip to content

Commit 7ff822c

Browse files
committed
CLI: ignore the exact error message
There error is slightly different for different Elixir versions
1 parent 50f73b2 commit 7ff822c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

deps/rabbitmq_cli/test/ctl/set_permissions_command_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ defmodule SetPermissionsCommandTest do
9696

9797
@tag user: @user, vhost: @root
9898
test "run: invalid regex patterns returns an error", context do
99-
assert @command.run(
99+
assert match?({:error, {:invalid_regexp, ~c"*", _}}, @command.run(
100100
[context[:user], "^#{context[:user]}-.*", ".*", "*"],
101101
context[:opts]
102-
) == {:error, {:invalid_regexp, ~c"*", {~c"quantifier does not follow a repeatable item", 0}}}
102+
))
103103

104104
# asserts that the failed command didn't change anything
105105
u = Enum.find(list_permissions(context[:vhost]), fn x -> x[:user] == context[:user] end)

deps/rabbitmq_cli/test/ctl/set_permissions_globally_command_test.exs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ defmodule SetPermissionsGloballyCommandTest do
9797
p2 = Enum.find(list_permissions(@vhost2), fn x -> x[:user] == context[:user] end)
9898
p3 = Enum.find(list_permissions(@vhost3), fn x -> x[:user] == context[:user] end)
9999

100-
assert @command.run(
101-
[context[:user], "^#{context[:user]}-.*", ".*", "*"],
102-
context[:opts]
103-
) == {:error, {:invalid_regexp, ~c"*", {~c"quantifier does not follow a repeatable item", 0}}}
100+
assert match?({:error, {:invalid_regexp, ~c"*", _}}, @command.run(
101+
[context[:user], "^#{context[:user]}-.*", ".*", "*"],
102+
context[:opts]
103+
))
104104

105105
# asserts that the failed command didn't change anything
106106
p4 = Enum.find(list_permissions(@vhost1), fn x -> x[:user] == context[:user] end)

0 commit comments

Comments
 (0)