summaryrefslogtreecommitdiff
path: root/puppet/modules/ntp/spec/system/class_spec.rb
blob: 49dfc64117cbbc4404e0f2ecc249fafbb77d60a9 (plain)
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
38
39
require 'spec_helper_system'

describe "ntp class:" do
  context 'should run successfully' do
    pp = "class { 'ntp': }"

    context puppet_apply(pp) do
      its(:stderr) { should be_empty }
      its(:exit_code) { should_not == 1 }
      its(:refresh) { should be_nil }
      its(:stderr) { should be_empty }
      its(:exit_code) { should be_zero }
    end
  end

  context 'service_ensure => stopped:' do
    pp = "class { 'ntp': service_ensure => stopped }"

    context puppet_apply(pp) do
      its(:stderr) { should be_empty }
      its(:exit_code) { should_not == 1 }
      its(:refresh) { should be_nil }
      its(:stderr) { should be_empty }
      its(:exit_code) { should be_zero }
    end
  end

  context 'service_ensure => running:' do
    pp = "class { 'ntp': service_ensure => running }"

    context puppet_apply(pp) do |r|
      its(:stderr) { should be_empty }
      its(:exit_code) { should_not == 1 }
      its(:refresh) { should be_nil }
      its(:stderr) { should be_empty }
      its(:exit_code) { should be_zero }
    end
  end
end