File tree 3 files changed +25
-8
lines changed
3 files changed +25
-8
lines changed Original file line number Diff line number Diff line change 4
4
5
5
RSpec . configure do |c |
6
6
c . module_path = File . join ( fixture_path , 'modules' )
7
- c . manifest_dir = File . join ( fixture_path , 'manifests' )
8
7
c . manifest = File . join ( fixture_path , 'manifests' , 'site.pp' )
9
8
c . environmentpath = File . join ( Dir . pwd , 'spec' )
10
9
end
Original file line number Diff line number Diff line change 10
10
end
11
11
let ( :node ) { 'test123.test.com' }
12
12
13
- it { is_expected . to contain_class ( 'server_facts' ) }
14
- it { is_expected . to compile . with_all_deps }
15
- it { is_expected . to contain_notify ( 'servername-test123.test.com' ) }
16
- it { is_expected . to contain_notify ( 'serverip-192.168.1.10' ) }
17
- it { is_expected . to contain_notify ( "serverversion-#{ Puppet . version } " ) }
18
- it { is_expected . to contain_notify ( 'environment-rp_env' ) }
19
- end
13
+ it { is_expected . to contain_class ( 'server_facts' ) }
14
+ it { is_expected . to compile . with_all_deps }
15
+ it { is_expected . to contain_notify ( 'servername-test123.test.com' ) }
16
+ it { is_expected . to contain_notify ( 'serverip-192.168.1.10' ) }
17
+ it { is_expected . to contain_notify ( "serverversion-#{ Puppet . version } " ) }
18
+ it { is_expected . to contain_notify ( 'environment-rp_env' ) }
20
19
end
Original file line number Diff line number Diff line change @@ -31,6 +31,25 @@ def context_double(options = {})
31
31
end
32
32
end
33
33
34
+ it 'sets Puppet[:strict_variables] to false by default' do
35
+ subject . setup_puppet ( context_double )
36
+ # strict variables enabled by default in puppet 8.x +
37
+ setting = Puppet ::Util ::Package . versioncmp ( Puppet . version , '8.0.0' ) >= 0
38
+ expect ( Puppet [ :strict_variables ] ) . to be ( setting )
39
+ end
40
+
41
+ it 'reads the :strict_variables setting' do
42
+ context = context_double strict_variables : true
43
+ subject . setup_puppet ( context )
44
+ expect ( Puppet [ :strict_variables ] ) . to be ( true )
45
+ end
46
+
47
+ it 'overrides the environmentpath set by Puppet::Test::TestHelper' do
48
+ context = context_double environmentpath : '/path/to/my/environments'
49
+ subject . setup_puppet ( context )
50
+ expect ( Puppet [ :environmentpath ] ) . to match ( %r{(C:)?/path/to/my/environments} )
51
+ end
52
+
34
53
describe '#set_setting' do
35
54
describe 'with a context specific setting' do
36
55
it 'sets the Puppet setting based on the example group setting' do
You can’t perform that action at this time.
0 commit comments