File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141 }
4242 end
4343else
44+ # Puppet version < 4 will use these tests.
4445 describe 'deprecation' do
4546 after ( :all ) do
4647 ENV . delete ( 'STDLIB_LOG_DEPRECATIONS' )
4748 end
48- ENV [ 'STDLIB_LOG_DEPRECATIONS' ] = "true"
49+ before ( :all ) do
50+ ENV [ 'STDLIB_LOG_DEPRECATIONS' ] = "true"
51+ end
4952 it { is_expected . not_to eq ( nil ) }
5053 it { is_expected . to run . with_params ( ) . and_raise_error ( Puppet ::ParseError , /wrong number of arguments/i ) }
5154
5457 is_expected . to run . with_params ( 'key' , 'heelo' )
5558 end
5659 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
5777end
You can’t perform that action at this time.
0 commit comments