File: contains_spec.rb

package info (click to toggle)
puppet-module-puppetlabs-ntp 7.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 496 kB
  • sloc: ruby: 1,481; sh: 46; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 1,046 bytes parent folder | download
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
# To check the correct dependancies are set up for NTP.

require 'spec_helper'
describe 'ntp' do
  let(:facts) { { is_virtual: false } }
  let :pre_condition do
    'file { "foo.rb":
      ensure => present,
      path => "/etc/tmp",
      notify => Service["ntp"] }'
  end

  on_supported_os.reject { |_, f| f[:os]['family'] == 'Solaris' }.each do |os, f|
    context "on #{os}" do
      let(:facts) do
        f.merge(super())
      end

      it { is_expected.to compile.with_all_deps }
      describe 'Testing the dependancies between the classes' do
        it { is_expected.to contain_class('ntp::install') }
        it { is_expected.to contain_class('ntp::config') }
        it { is_expected.to contain_class('ntp::service') }
        it { is_expected.to contain_class('ntp::install').that_comes_before('Class[ntp::config]') }
        it { is_expected.to contain_class('ntp::service').that_subscribes_to('Class[ntp::config]') }
        it { is_expected.to contain_file('foo.rb').that_notifies('Service[ntp]') }
      end
    end
  end
end