Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/melezhik/perl6-powershell-testing
Powershell testing with Sparrow6
https://github.com/melezhik/perl6-powershell-testing
perl6 powershell sparrow6 testing
Last synced: about 5 hours ago
JSON representation
Powershell testing with Sparrow6
- Host: GitHub
- URL: https://github.com/melezhik/perl6-powershell-testing
- Owner: melezhik
- Created: 2019-07-27T02:45:56.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-07-27T02:56:52.000Z (over 5 years ago)
- Last Synced: 2024-11-05T18:56:48.548Z (about 2 months ago)
- Topics: perl6, powershell, sparrow6, testing
- Language: Perl 6
- Size: 2.93 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sparrow6 Powershell Testing
Example of testing Powershell modules using Sparrow6
# Usage
## Write Powershell module
`modules/hello/hello.ps1`
function Hello {
param(
[Parameter(Mandatory=$true)]
[String]$name
)
Write-Host Hello $name
}## Write Sparrow6 wrapper
mkdir -p .tom/tasks/hello
`.tom/tasks/hello/task.ps1`:
Import-Module hello
$name = config 'name'
Hello -name $name`.tom/tasks/hello/task.check`:
generator: print "Hello ".( config()->{name} )
## Write Tomtit task
`tom --edit test-hello`
task-run ".tom/tasks/test-hello", %( name => "Sparrow6" )
## Run test
`PSModulePath=$PWD/modules tom test-hello`
02:47:26 07/27/2019 [repository] index updated from file:///home/melezhik/repo/api/v1/index
02:47:26 07/27/2019 [.tom/tasks/test-hello] Hello Sparrow6
[task check] stdout match True# Author
Alexey Melezhik