File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 88 end
99
1010 def deprecation ( key , message )
11+ stacktrace = Puppet ::Pops ::PuppetStack . stacktrace ( )
12+ file = stacktrace [ 0 ]
13+ line = stacktrace [ 1 ]
14+ output_message = "#{ message } at #{ file } :#{ line } "
1115 # depending on configuration setting of strict
1216 case Puppet . settings [ :strict ]
1317 when :off
1418 # do nothing
1519 when :error
16- fail ( "deprecation. #{ key } . #{ message } " )
20+ fail ( "deprecation. #{ key } . #{ output_message } " )
1721 else
1822 unless ENV [ 'STDLIB_LOG_DEPRECATIONS' ] == 'false'
19- Puppet . deprecation_warning ( message , key )
23+ Puppet . deprecation_warning ( output_message , key )
2024 end
2125 end
2226 end
Original file line number Diff line number Diff line change 3131 end
3232
3333 it "should show the error message" do
34- expect ( @result . stderr ) . to match ( /deprecation. key. message/ )
34+ expect ( @result . stderr ) . to match ( /deprecation. key. \$ \{ message\} / )
3535 end
3636
3737 describe file ( "#{ test_file } " ) do
5353 end
5454
5555 it "should show the error message" do
56- expect ( @result . stderr ) . to match ( /Warning: message/ )
56+ expect ( @result . stderr ) . to match ( /Warning: \$ \{ message\} at \$ \{ stacktrace \[ 0 \] \[ 0 \] \} : \$ \{ stacktrace \[ 0 \] : \[ 1 \] \} / )
5757 end
5858
5959 describe file ( "#{ test_file } " ) do
You can’t perform that action at this time.
0 commit comments