summaryrefslogtreecommitdiff
path: root/spec/functions/defined_with_params_spec.rb
diff options
context:
space:
mode:
authorDominic Cleal <dominic@cleal.org>2017-04-27 10:00:04 +0100
committerHelen Campbell <helen@puppetlabs.com>2017-05-09 12:51:40 +0100
commit9244c67206363f8e887531b164fc24cef729f3d8 (patch)
treee275e9cf106f6af80ed4dd38295fe9a5879683a2 /spec/functions/defined_with_params_spec.rb
parent052d55b046706b6d68b69ac91e8d688009b3fdc1 (diff)
Test for defined_with_params() returning false for defined types
defined_with_params() now returns false for defined types, causing duplicate resources when using ensure_resources(). Introduced by 4f19c27 in PE-20308.
Diffstat (limited to 'spec/functions/defined_with_params_spec.rb')
-rwxr-xr-xspec/functions/defined_with_params_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/functions/defined_with_params_spec.rb b/spec/functions/defined_with_params_spec.rb
index 7118d85..775fa74 100755
--- a/spec/functions/defined_with_params_spec.rb
+++ b/spec/functions/defined_with_params_spec.rb
@@ -55,4 +55,12 @@ describe 'defined_with_params' do
end
end
end
+
+ describe 'when passed a defined type' do
+ let :pre_condition do
+ 'test::deftype { "foo": }'
+ end
+ it { is_expected.to run.with_params('Test::Deftype[foo]', {}).and_return(true) }
+ it { is_expected.to run.with_params('Test::Deftype[bar]', {}).and_return(false) }
+ end
end