-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_spec.rb
32 lines (28 loc) · 1.01 KB
/
config_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require 'spec_helper'
describe 'ntp::config' do
context 'for a Linux distribution' do
let(:facts) {{ :kernel => 'Linux', :osfamily => 'RedHat' }}
it do
should contain_file('ntp.conf').with({
'path' => '/etc/ntp.conf',
'ensure' => 'file',
'mode' => '0644',
'owner' => 'root',
'group' => 'root',
'content' => /server 0.us.pool.ntp.org iburst\nserver 1.us.pool.ntp.org iburst\nserver 2.us.pool.ntp.org iburst\nserver 3.us.pool.ntp.org iburst/,
'notify' => 'Service[ntp]',
})
end
end
context 'for a Windows distribution' do
let(:facts) {{ :kernel => 'Windows', :osfamily => 'Windows' }}
it do
should contain_file('ntp.conf').with({
'path' => 'c:\\ntp\\etc\\ntp.conf',
'ensure' => 'file',
'content' => /server 0.us.pool.ntp.org iburst\nserver 1.us.pool.ntp.org iburst\nserver 2.us.pool.ntp.org iburst\nserver 3.us.pool.ntp.org iburst/,
'notify' => 'Service[ntp]',
})
end
end
end