Skip to content

Commit 5f30e76

Browse files
authored
Merge pull request #1019 from wyardley/wyardley/issues_1017
Convert `queue-version` to integer
2 parents 47be9d0 + 95e749d commit 5f30e76

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/puppet/type/rabbitmq_policy.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
max-length
1212
max-length-bytes
1313
message-ttl
14+
queue-version
1415
shards-per-node
1516
].freeze
1617

spec/unit/puppet/type/rabbitmq_policy_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,19 @@
221221
end.to raise_error(Puppet::Error, %r{Invalid initial-cluster-size value 'impressive})
222222
end
223223

224+
it 'accepts and converts the queue-version value' do
225+
definition = { 'queue-version' => '2' }
226+
policy[:definition] = definition
227+
expect(policy[:definition]['queue-version']).to eq(2)
228+
end
229+
230+
it 'does not accept non-numeric queue-version value' do
231+
definition = { 'queue-version' => 'oogabooga' }
232+
expect do
233+
policy[:definition] = definition
234+
end.to raise_error(Puppet::Error, %r{Invalid queue-version value.*oogabooga})
235+
end
236+
224237
context 'accepts list value in ha-params when ha-mode = nodes' do
225238
before do
226239
policy[:definition] = definition

0 commit comments

Comments
 (0)