From 1e9be339f7c948df71e7aebe61472011d35071b6 Mon Sep 17 00:00:00 2001 From: Andras Elso Date: Tue, 23 Jul 2024 19:12:22 +0200 Subject: [PATCH] Add specs for physical_volume --- spec/unit/type/logical_volume_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/unit/type/logical_volume_spec.rb b/spec/unit/type/logical_volume_spec.rb index d4dac5ce..999206e7 100644 --- a/spec/unit/type/logical_volume_spec.rb +++ b/spec/unit/type/logical_volume_spec.rb @@ -185,6 +185,19 @@ }.not_to raise_error end + it 'raises an ArgumentError when the physical volume is neither string nor array' do + expect { + resource = Puppet::Type.type(:logical_volume).new( + name: 'john', + ensure: :present, + volume_group: 'ernie', + size: '10M', + physical_volume: 42, + ) + }.to raise_error(Puppet::ResourceError, + 'physical_volume should be String or Array: 42') + end + it 'invalid number of stripes raises error' do expect { resource = Puppet::Type.type(:logical_volume).new(