Skip to content

Commit 1e3a551

Browse files
committed
Add tests for ensure absent, notify, and subscribe
1 parent 5d11e72 commit 1e3a551

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: spec/defines/collect_spec.rb

+9
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919
is_expected.to contain_file('/etc/systemd/system/pe_databases-test.service').with_content(
2020
%r{ExecStart=foo},
2121
)
22+
23+
is_expected.to contain_service('pe_databases-test.service').that_notifies(
24+
'Exec[pe_databases_daemon_reload]',
25+
)
26+
is_expected.to contain_service('pe_databases-test.timer').that_subscribes_to(
27+
'File[/etc/systemd/system/pe_databases-test.timer]',
28+
)
2229
}
2330
end
2431

@@ -34,6 +41,8 @@
3441
end
3542

3643
it {
44+
is_expected.to contain_file('/etc/systemd/system/pe_databases-test.timer').with_ensure('absent')
45+
is_expected.to contain_file('/etc/systemd/system/pe_databases-test.service').with_ensure('absent')
3746
is_expected.to contain_service('pe_databases-test.timer').with_ensure('stopped')
3847
}
3948
end

0 commit comments

Comments
 (0)