clispark 1.20.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/powershell/Public/Complete-Task.ps1 +10 -0
- package/templates/powershell/Public/Get-Task.ps1 +17 -0
- package/templates/powershell/Public/New-Task.ps1 +17 -0
- package/templates/powershell/tests/Complete-Task.Tests.ps1 +5 -0
- package/templates/powershell/tests/Get-Task.Tests.ps1 +13 -0
- package/templates/powershell/tests/New-Task.Tests.ps1 +9 -0
package/package.json
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function Get-Task {
|
|
2
|
+
[CmdletBinding()]
|
|
3
|
+
param(
|
|
4
|
+
[Parameter(Position = 0)]
|
|
5
|
+
[string]$Filter,
|
|
6
|
+
|
|
7
|
+
[switch]$Done
|
|
8
|
+
)
|
|
9
|
+
process {
|
|
10
|
+
$base = if ($Filter) { "Listing tasks matching `"$Filter`"" } else { 'Listing all tasks' }
|
|
11
|
+
if ($Done) {
|
|
12
|
+
Write-Output "$base (completed only: true)"
|
|
13
|
+
} else {
|
|
14
|
+
Write-Output $base
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function New-Task {
|
|
2
|
+
[CmdletBinding()]
|
|
3
|
+
param(
|
|
4
|
+
[Parameter(Mandatory, Position = 0)]
|
|
5
|
+
[string]$Title,
|
|
6
|
+
|
|
7
|
+
[ValidateSet('Low', 'Medium', 'High')]
|
|
8
|
+
[string]$Priority
|
|
9
|
+
)
|
|
10
|
+
process {
|
|
11
|
+
if ($Priority) {
|
|
12
|
+
Write-Output "Created task: `"$Title`" (priority: $Priority)"
|
|
13
|
+
} else {
|
|
14
|
+
Write-Output "Created task: `"$Title`""
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Describe 'Get-Task' {
|
|
2
|
+
It 'lists all tasks by default' {
|
|
3
|
+
Get-Task | Should -Be 'Listing all tasks'
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
It 'lists tasks matching a filter' {
|
|
7
|
+
Get-Task -Filter 'groceries' | Should -Be 'Listing tasks matching "groceries"'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
It 'lists tasks matching a filter, showing only completed ones' {
|
|
11
|
+
Get-Task -Filter 'groceries' -Done | Should -Be 'Listing tasks matching "groceries" (completed only: true)'
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Describe 'New-Task' {
|
|
2
|
+
It 'creates a task with just a title' {
|
|
3
|
+
New-Task -Title 'Buy milk' | Should -Be 'Created task: "Buy milk"'
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
It 'creates a task with an optional priority' {
|
|
7
|
+
New-Task -Title 'Buy milk' -Priority 'High' | Should -Be 'Created task: "Buy milk" (priority: High)'
|
|
8
|
+
}
|
|
9
|
+
}
|