Add new pester test to clean up created file

This commit is contained in:
George Fleming
2016-01-06 10:14:17 -08:00
parent 6a40891df2
commit ed59522056
2 changed files with 27 additions and 0 deletions
@@ -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";
};