Skip to content

Commit ee2a7e6

Browse files
🪲 [Fix]: Move Get-Context tests to after some are created (#39)
## Description - Move Get-Context tests to after some are created ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas
1 parent a1163bb commit ee2a7e6

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

tests/Context.Tests.ps1

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,6 @@
44
[CmdletBinding()]
55
param()
66
Describe 'Context' {
7-
Context 'Function: Get-Context' {
8-
It 'Function is be available' {
9-
Get-Command -Name 'Get-Context' | Should -Not -BeNullOrEmpty
10-
}
11-
12-
It 'Get-Context - Should return all contexts' {
13-
{ Get-Context } | Should -Not -Throw
14-
}
15-
16-
It "Get-Context -Name '*' - Should return all contexts" {
17-
{ Get-Context -Name '*' } | Should -Not -Throw
18-
}
19-
20-
It "Get-Context -Name '' - Should return no contexts" {
21-
{ Get-Context -Name '' } | Should -Not -Throw
22-
Get-Context -Name '' | Should -BeNullOrEmpty
23-
}
24-
It 'Get-Context -Name $null - Should return no contexts' {
25-
{ Get-Context -Name $null } | Should -Not -Throw
26-
Get-Context -Name $null | Should -BeNullOrEmpty
27-
}
28-
}
29-
307
Context 'Function: Set-Context' {
318
It 'Function is be available' {
329
Get-Command -Name 'Set-Context' | Should -Not -BeNullOrEmpty
@@ -71,6 +48,29 @@ Describe 'Context' {
7148
}
7249
}
7350

51+
Context 'Function: Get-Context' {
52+
It 'Function is be available' {
53+
Get-Command -Name 'Get-Context' | Should -Not -BeNullOrEmpty
54+
}
55+
56+
It 'Get-Context - Should return all contexts' {
57+
{ Get-Context } | Should -Not -Throw
58+
}
59+
60+
It "Get-Context -Name '*' - Should return all contexts" {
61+
{ Get-Context -Name '*' } | Should -Not -Throw
62+
}
63+
64+
It "Get-Context -Name '' - Should return no contexts" {
65+
{ Get-Context -Name '' } | Should -Not -Throw
66+
Get-Context -Name '' | Should -BeNullOrEmpty
67+
}
68+
It 'Get-Context -Name $null - Should return no contexts' {
69+
{ Get-Context -Name $null } | Should -Not -Throw
70+
Get-Context -Name $null | Should -BeNullOrEmpty
71+
}
72+
}
73+
7474
Context 'Function: Remove-Context' {
7575
It 'Function is be available' {
7676
Get-Command -Name 'Remove-Context' | Should -Not -BeNullOrEmpty

0 commit comments

Comments
 (0)