forked from olevole/puppetlabs-ntp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclass_spec.rb
37 lines (30 loc) · 1019 Bytes
/
class_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
33
34
35
36
37
require 'spec_helper_acceptance'
describe 'ntp class:', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
it 'should run successfully' do
pp = "class { 'ntp': }"
# Apply twice to ensure no errors the second time.
apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stderr).not_to match(/error/i)
end
apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stderr).not_to eq(/error/i)
expect(r.exit_code).to be_zero
end
end
context 'service_ensure => stopped:' do
it 'runs successfully' do
pp = "class { 'ntp': service_ensure => stopped }"
apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stderr).not_to match(/error/i)
end
end
end
context 'service_ensure => running:' do
it 'runs successfully' do
pp = "class { 'ntp': service_ensure => running }"
apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stderr).not_to match(/error/i)
end
end
end
end