Skip to content

Commit b8722fb

Browse files
committed
skip the apt tests on non-linux systems.
1 parent eabdb98 commit b8722fb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

resources/apt/test/apt.tests.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Describe 'Apt resource tests' {
77
}
88

99
Context "export" {
10-
It "should have more than 20 resources" {
10+
It "should have more than 20 resources" -Skip:$(! $IsLinux) {
1111
if (-not $aptExists) {
1212
Set-ItResult -Skip -Because "Apt not found"
1313
}
@@ -23,7 +23,7 @@ Describe 'Apt resource tests' {
2323
$yamlPath = "$PSScriptRoot/assets/apt_${pkgName}.dsc.yaml"
2424
}
2525

26-
It 'Config get works' {
26+
It 'Config get works' -Skip:$(! $IsLinux) {
2727
if (-not $aptExists) {
2828
Set-ItResult -Skip -Because "Apt not found"
2929
}
@@ -34,7 +34,7 @@ Describe 'Apt resource tests' {
3434
$observed | Should -Be $exists
3535
}
3636

37-
It 'Config test works' {
37+
It 'Config test works' -Skip:$(! $IsLinux) {
3838
if (-not $aptExists) {
3939
Set-ItResult -Skip -Because "Apt not found"
4040
}
@@ -53,7 +53,7 @@ Describe 'Apt resource tests' {
5353
$yamlUnInstallPath = "$PSScriptRoot/assets/apt_uninstall_${pkgName}.dsc.yaml"
5454
}
5555

56-
It 'Can install a package' {
56+
It 'Can install a package' -Skip:$(! $IsLinux) {
5757
Set-ItResult -Skip -Because "Apt requires sudo"
5858

5959
if (apt list $pkgname 2>&1 | Select-String installed ) {
@@ -65,7 +65,7 @@ Describe 'Apt resource tests' {
6565
$result.results[1].result.afterstate._exist | Should -Be true
6666
}
6767

68-
It 'Can uninstall a package' {
68+
It 'Can uninstall a package' -Skip:$(! $IsLinux) {
6969
Set-ItResult -Skip -Because "Apt requires sudo"
7070

7171
if ($null -eq (apt list $pkgName 2>&1 | Select-String installed)) {

0 commit comments

Comments
 (0)