mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add new pester test to clean up created file
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$mof = "$here/assets/sample.mof"
|
||||
$mofCleanup = "$here/assets/sample-cleanup.mof"
|
||||
$mofMeta = "$here/assets/sampleMeta.mof"
|
||||
$file = "/tmp/linux.txt"
|
||||
|
||||
@@ -21,6 +22,13 @@ Describe "DscConfiguration" {
|
||||
$s.VALUE | Should Be "0"
|
||||
}
|
||||
|
||||
It "Should remove temp file just created" {
|
||||
$s = Start-DscConfiguration -ConfigurationMof $mofCleanup |
|
||||
Where-Object {$_.NAME -eq "ReturnValue"}
|
||||
$s.VALUE | Should Be "0"
|
||||
$file | Should Not Exist
|
||||
}
|
||||
|
||||
It "Should set Meta MOF file properly" {
|
||||
$s = Set-DscLocalConfigurationManager -ConfigurationMof $mofMeta |
|
||||
Where-Object {$_.NAME -eq "ReturnValue"}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
instance of MSFT_nxFileResource
|
||||
{
|
||||
Contents = "my contents";
|
||||
DestinationPath = "/tmp/linux.txt";
|
||||
Ensure = "Absent";
|
||||
Type = "File";
|
||||
ResourceId = "[MSFT_nxFileResource]File1";
|
||||
ModuleName = "nx";
|
||||
ModuleVersion = "1.0";
|
||||
|
||||
|
||||
};
|
||||
|
||||
instance of OMI_ConfigurationDocument
|
||||
{
|
||||
Version="1.0.0";
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user