Skip to content

Commit 03f2939

Browse files
committed
Add test for voxpupuli#199
Signed-off-by: Simon Deziel <[email protected]>
1 parent e4907f1 commit 03f2939

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

spec/defines/timer_spec.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,27 @@
7070
it { is_expected.to contain_systemd__unit_file('gamma.service').with_content("[Service]\nExecStart=/bin/touch /tmp/foobar") }
7171
end
7272

73+
context 'with timer activated service' do
74+
let(:params) do
75+
{
76+
active: true,
77+
enable: true,
78+
timer_content: "[Timer]\nOnCalendar=hourly",
79+
service_content: "[Service]\nExecStart=/bin/echo timer-fired",
80+
}
81+
end
82+
83+
it { is_expected.to contain_systemd__unit_file('foobar.timer').with_content("[Timer]\nOnCalendar=hourly") }
84+
it { is_expected.to contain_systemd__unit_file('foobar.service').with_content("[Service]\nExecStart=/bin/echo timer-fired") }
85+
86+
it {
87+
is_expected.to create_exec('foobar.service-systemctl-daemon-reload').with(
88+
command: "systemctl daemon-reload",
89+
refreshonly: true,
90+
)
91+
}
92+
end
93+
7394
context 'with a bad timer name' do
7495
let(:title) { 'foobar' }
7596

0 commit comments

Comments
 (0)