File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 11# This configuration was generated by
22# `rubocop --auto-gen-config`
3- # on 2025-10-08 09:39:08 UTC using RuboCop version 1.73.2.
3+ # on 2025-10-08 10:43:51 UTC using RuboCop version 1.73.2.
44# The point is for the user to remove these configuration records
55# one by one as the offenses are removed from the code base.
66# Note that changes in the inspected code, or installation of new
77# versions of RuboCop, may require this file to be generated again.
88
9- # Offense count: 1
9+ # Offense count: 2
1010# This cop supports safe autocorrection (--autocorrect).
1111RSpec/ExpectActual :
1212 Exclude :
Original file line number Diff line number Diff line change @@ -8,10 +8,13 @@ def read_fixture(name)
88end
99
1010def read_win_file_if_exists ( path )
11- ps = %{$p='#{ path } '; if (Test-Path -LiteralPath $p) { Get-Content -Raw -LiteralPath $p } else { '<<<FILE_NOT_FOUND>>>' }}
11+ # Use a script block with literals; avoid $variables to prevent transport/quoting expansion
12+ # Also keep exit 0 regardless of existence so run_shell doesn't raise.
13+ ps = %{& { if (Test-Path -LiteralPath '#{ path } ') { Get-Content -Raw -LiteralPath '#{ path } ' } else { '<<<FILE_NOT_FOUND>>>' } } }
1214 r = run_shell ( %(powershell.exe -NoProfile -NonInteractive -Command "#{ ps } ") )
1315 body = ( r . stdout || '' ) . to_s
14- { exists : !body . include? ( '<<<FILE_NOT_FOUND>>>' ) , content : body . include? ( '<<<FILE_NOT_FOUND>>>' ) ? '' : body }
16+ exists = !body . include? ( '<<<FILE_NOT_FOUND>>>' )
17+ { exists : exists , content : exists ? body : '' }
1518end
1619
1720describe 'deferred values with dsc_lite' do
You can’t perform that action at this time.
0 commit comments