File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 41
41
}
42
42
end
43
43
else
44
+ # Puppet version < 4 will use these tests.
44
45
describe 'deprecation' do
45
46
after ( :all ) do
46
47
ENV . delete ( 'STDLIB_LOG_DEPRECATIONS' )
47
48
end
48
- ENV [ 'STDLIB_LOG_DEPRECATIONS' ] = "true"
49
+ before ( :all ) do
50
+ ENV [ 'STDLIB_LOG_DEPRECATIONS' ] = "true"
51
+ end
49
52
it { is_expected . not_to eq ( nil ) }
50
53
it { is_expected . to run . with_params ( ) . and_raise_error ( Puppet ::ParseError , /wrong number of arguments/i ) }
51
54
54
57
is_expected . to run . with_params ( 'key' , 'heelo' )
55
58
end
56
59
end
60
+ # Tests the Puppet 3 setup with future parser enabled.
61
+ if ENV [ 'FUTURE_PARSER' ] = "true"
62
+ describe 'deprecation' do
63
+ after ( :all ) do
64
+ ENV . delete ( 'STDLIB_LOG_DEPRECATIONS' )
65
+ end
66
+ before ( :all ) do
67
+ ENV [ 'STDLIB_LOG_DEPRECATIONS' ] = "true"
68
+ end
69
+ it { is_expected . not_to eq ( nil ) }
70
+ it { is_expected . to run . with_params ( ) . and_raise_error ( Puppet ::ParseError , /wrong number of arguments/i ) }
71
+ it 'should display a single warning' do
72
+ scope . expects ( :warning ) . with ( includes ( 'heelo' ) )
73
+ is_expected . to run . with_params ( 'key' , 'heelo' )
74
+ end
75
+ end
76
+ end
57
77
end
You can’t perform that action at this time.
0 commit comments