Skip to content

Commit 760bcd3

Browse files
committed
Add a transitive test property
This is a minimal reproducer that's essentially A ~> B ~> C. The that_subscribes_to matcher shows that this is equal to A ~> C but in practice Puppet doesn't work that way. The service is not restarted if the file is modified. I don't know what is the expected behavior here, but it does mean that today it's not possible to test for real world behavior.
1 parent b8b1412 commit 760bcd3

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

spec/classes/relationship__notify_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@
1717

1818
it { should contain_notify('pre').that_notifies(['Notify[post]']) }
1919
it { should contain_notify('post').that_subscribes_to(['Notify[pre]']) }
20+
21+
# TODO: in practice this transitive notification doesn't work
22+
it { should contain_service('myservice').that_subscribes_to('File[/tmp/file.txt]') }
2023
end

spec/fixtures/modules/relationships/manifests/notify.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
class { '::relationships::notify::pre': } ~>
1616
class { '::relationships::notify::middle': } ~>
1717
class { '::relationships::notify::post': }
18+
19+
file { '/tmp/file.txt': } ~>
20+
file { '/tmp/directory': } ~>
21+
service { 'myservice': }
1822
}
1923

2024
class relationships::notify::pre {

0 commit comments

Comments
 (0)