Skip to content
Permalink
Browse files

(maint) Tests for validating extra relationship edge cases

Signed-off-by: Ken Barber <ken@bob.sh>
  • Loading branch information
kbarber committed Feb 8, 2016
1 parent 02f11a8 commit 76ae1022cc754389bfac157c29159741b523b41d
Showing with 31 additions and 0 deletions.
  1. +31 −0 spec/integration/parser/compiler_spec.rb
@@ -1257,6 +1257,37 @@ class foo::bar::baz {
end
end

# As documented here: https://docs.puppetlabs.com/puppet/latest/reference/metaparameter.html#alias
describe "relationships to resource aliases" do
[ 'before',
'subscribe',
'notify',
'require'].each do |meta_param|
it "should compile correctly when used on parameter #{meta_param}" do
compile_to_catalog(<<-PP)
notify{ x : alias => y }
notify{ z : #{meta_param} => Notify[y] }
PP
end
end
end

# This was tested in PuppetDB, and we performed munging on it, which means
# at one point this was allowed.
describe "relationships to trailing forward slashes" do
[ 'before',
'subscribe',
'notify',
'require'].each do |meta_param|
it "should compile correctly when used on parameter #{meta_param}" do
compile_to_catalog(<<-PP)
file{ '/tmp/foo/': }
notify{ z : #{meta_param} => File['/tmp/foo'] }
PP
end
end
end

describe "relationships can be formed" do
def extract_name(ref)
ref.sub(/File\[(\w+)\]/, '\1')

0 comments on commit 76ae102

Please sign in to comment.
You can’t perform that action at this time.