Skip to content

Commit

Permalink
Merge pull request #1019 from wyardley/wyardley/issues_1017
Browse files Browse the repository at this point in the history
Convert `queue-version` to integer
  • Loading branch information
bastelfreak authored Sep 6, 2024
2 parents 47be9d0 + 95e749d commit 5f30e76
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/puppet/type/rabbitmq_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
max-length
max-length-bytes
message-ttl
queue-version
shards-per-node
].freeze

Expand Down
13 changes: 13 additions & 0 deletions spec/unit/puppet/type/rabbitmq_policy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,19 @@
end.to raise_error(Puppet::Error, %r{Invalid initial-cluster-size value 'impressive})
end

it 'accepts and converts the queue-version value' do
definition = { 'queue-version' => '2' }
policy[:definition] = definition
expect(policy[:definition]['queue-version']).to eq(2)
end

it 'does not accept non-numeric queue-version value' do
definition = { 'queue-version' => 'oogabooga' }
expect do
policy[:definition] = definition
end.to raise_error(Puppet::Error, %r{Invalid queue-version value.*oogabooga})
end

context 'accepts list value in ha-params when ha-mode = nodes' do
before do
policy[:definition] = definition
Expand Down

0 comments on commit 5f30e76

Please sign in to comment.