File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-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+ output_message = "${message} at ${stacktrace[0][0]}:${stacktrace[0]:[1]}"
1113 # depending on configuration setting of strict
1214 case Puppet . settings [ :strict ]
1315 when :off
1416 # do nothing
1517 when :error
16- fail ( "deprecation. #{ key } . #{ message } " )
18+ fail ( "deprecation. #{ key } . #{ output_message } " )
1719 else
1820 unless ENV [ 'STDLIB_LOG_DEPRECATIONS' ] == 'false'
19- Puppet . deprecation_warning ( message , key )
21+ Puppet . deprecation_warning ( output_message , key )
2022 end
2123 end
2224 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