From 40392c929aa9474cb645000aeb83773d24a21ae1 Mon Sep 17 00:00:00 2001 From: nosrio Date: Mon, 20 May 2024 12:46:32 -0300 Subject: [PATCH] Add unit test to handle bug solved on PR #993 --- spec/classes/rabbitmq_spec.rb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/spec/classes/rabbitmq_spec.rb b/spec/classes/rabbitmq_spec.rb index 5fc0e814b..14f1ab2bb 100644 --- a/spec/classes/rabbitmq_spec.rb +++ b/spec/classes/rabbitmq_spec.rb @@ -411,8 +411,22 @@ is_expected.to contain_file('rabbitmq.config').with('content' => %r{cluster_nodes.*\['rabbit@hare-1', 'rabbit@hare-2'\], ram}) end end - end + describe 'without cluster_nodes and sets appropriate configuration ' do + let(:params) do + { + config_cluster: true, + cluster_node_type: 'ram', + erlang_cookie: 'ORIGINAL', + wipe_db_on_cookie_change: true + } + end + + it 'for cluster_nodes' do + is_expected.to contain_file('rabbitmq.config').with('content' => %r{cluster_nodes.*\[\], ram}) + end + end + end describe 'rabbitmq-env configuration' do context 'with default params' do it 'sets environment variables' do