File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -543,19 +543,18 @@ InModuleScope ReadSettings { # Allows testing of private functions
543543
544544 It ' ValidateSettings skips validation entirely on PS versions less than 7 without warning' {
545545 Mock OutputWarning { }
546- Mock Test-Json { }
547546
548547 $settings = @ { " someProp" = " someValue" }
549548
550- ValidateSettings - settings $settings
551-
552549 if ($PSVersionTable.PSVersion.Major -ge 7 ) {
550+ Mock Test-Json { }
551+ ValidateSettings - settings $settings
553552 # On PS7+, Test-Json is called directly for validation
554553 Should - Invoke - CommandName Test-Json - Times 1
555554 }
556555 else {
557- # On PS < 7, validation is skipped entirely
558- Should - Invoke - CommandName Test-Json - Times 0
556+ # On PS < 7, validation is skipped entirely; Test-Json doesn't exist so we just verify no warning
557+ ValidateSettings - settings $settings
559558 }
560559
561560 # Verify no warning was output
You can’t perform that action at this time.
0 commit comments