summaryrefslogtreecommitdiff
path: root/spec/functions/defined_with_params_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/functions/defined_with_params_spec.rb')
-rwxr-xr-xspec/functions/defined_with_params_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/functions/defined_with_params_spec.rb b/spec/functions/defined_with_params_spec.rb
index 516d986..e00c423 100755
--- a/spec/functions/defined_with_params_spec.rb
+++ b/spec/functions/defined_with_params_spec.rb
@@ -23,4 +23,13 @@ describe 'defined_with_params' do
it { is_expected.to run.with_params('User[dan]', {'ensure' => 'present', 'managehome' => false}).and_return(true) }
it { is_expected.to run.with_params('User[dan]', {'ensure' => 'absent', 'managehome' => false}).and_return(false) }
end
+
+ describe 'when passing undef values' do
+ let :pre_condition do
+ 'file { "/tmp/a": }'
+ end
+
+ it { is_expected.to run.with_params('File[/tmp/a]', {}).and_return(true) }
+ it { is_expected.to run.with_params('File[/tmp/a]', { 'owner' => :undef }).and_return(true) }
+ end
end