File tree 2 files changed +36
-5
lines changed
2 files changed +36
-5
lines changed Original file line number Diff line number Diff line change 65
65
# Anchor this as per #8040 - this ensures that classes won't float off and
66
66
# mess everything up. You can read about this at:
67
67
# http://docs.puppetlabs.com/puppet/2.7/reference/lang_containment.html#known-issues
68
- anchor { 'ntp::begin' : } ->
69
- class { '::ntp::install' : } ->
70
- class { '::ntp::config' : } ~>
71
- class { '::ntp::service' : } ->
72
- anchor { 'ntp::end' : }
68
+
69
+ contain ntp::install
70
+ contain ntp::config
71
+ contain ntp::service
72
+
73
+ Class[' ::ntp::install' ] ->
74
+ Class[' ::ntp::config' ] ~>
75
+ Class[' ::ntp::service' ]
73
76
}
Original file line number Diff line number Diff line change
1
+ # To check the correct dependancies are set up for NTP.
2
+
3
+ require 'spec_helper'
4
+ describe 'ntp' do
5
+ let ( :facts ) { { :is_virtual => 'false' } }
6
+ let :pre_condition do
7
+ 'file { "foo.rb":
8
+ ensure => present,
9
+ path => "/etc/tmp",
10
+ notify => Service["ntp"] }' end
11
+ on_supported_os . select { |_ , f | f [ :os ] [ 'family' ] != 'Solaris' } . each do |os , f |
12
+ context "on #{ os } " do
13
+ let ( :facts ) do
14
+ f . merge ( super ( ) )
15
+ end
16
+
17
+ it { is_expected . to compile . with_all_deps }
18
+ describe "Testing the dependancies between the classes" do
19
+ it { should contain_class ( 'ntp::install' ) }
20
+ it { should contain_class ( 'ntp::config' ) }
21
+ it { should contain_class ( 'ntp::service' ) }
22
+ it { is_expected . to contain_class ( 'ntp::install' ) . that_comes_before ( 'Class[ntp::config]' ) }
23
+ it { is_expected . to contain_class ( 'ntp::service' ) . that_subscribes_to ( 'Class[ntp::config]' ) }
24
+ it { is_expected . to contain_file ( 'foo.rb' ) . that_notifies ( 'Service[ntp]' ) }
25
+ end
26
+ end
27
+ end
28
+ end
You can’t perform that action at this time.
0 commit comments