Skip to content

Commit 3b5ccfc

Browse files
author
Kapil Borle
committed
Fix rule tests for CoreCLR on Linux
1 parent 22b1c3a commit 3b5ccfc

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Tests/Rules/AvoidUnloadableModuleOrMissingRequiredFieldInManifest.tests.ps1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
Import-Module PSScriptAnalyzer
1+
$directory = Split-Path -Parent $MyInvocation.MyCommand.Path
2+
$testRootDirectory = Split-Path -Parent $directory
3+
Import-Module PSScriptAnalyzer
4+
Import-Module (Join-Path $testRootDirectory 'PSScriptAnalyzerTestHelper.psm1')
5+
26
$missingMessage = "The member 'ModuleVersion' is not present in the module manifest."
37
$missingMemberRuleName = "PSMissingModuleManifestField"
4-
$directory = Split-Path -Parent $MyInvocation.MyCommand.Path
58
$violationFilepath = Join-Path $directory "TestBadModule\TestBadModule.psd1"
69
$violations = Invoke-ScriptAnalyzer $violationFilepath | Where-Object {$_.RuleName -eq $missingMemberRuleName}
710
$noViolations = Invoke-ScriptAnalyzer $directory\TestGoodModule\TestGoodModule.psd1 | Where-Object {$_.RuleName -eq $missingMemberRuleName}
@@ -30,9 +33,9 @@ Describe "MissingRequiredFieldModuleManifest" {
3033
$violations.SuggestedCorrections.Count | Should Be $numExpectedCorrections
3134
}
3235

33-
34-
It "has the right suggested correction" {
35-
$expectedText = @'
36+
# On Linux, mismatch in line endings cause this to fail
37+
It "has the right suggested correction" -Skip:(Test-PSEditionCoreCLRLinux) {
38+
$expectedText = @'
3639
# Version number of this module.
3740
ModuleVersion = '1.0.0.0'
3841
'@

0 commit comments

Comments
 (0)