Skip to content

Commit

Permalink
Fixing styling corrections and modifying Pester tests per @TravisEz13…
Browse files Browse the repository at this point in the history
…s comments
  • Loading branch information
tysonjhayes committed May 27, 2015
1 parent b1ee7d5 commit b9b9a93
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DSCResources/MSFT_xFirewall/MSFT_xFirewall.Schema.mof
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ class MSFT_xFirewall : OMI_BaseResource
[Write, Description("Documentation for the Rule")] String Description;
[Write, Description("Path and file name of the program for which the rule is applied")] String ApplicationPath;
[Write, Description("Specifies the short name of a Windows service to which the firewall rule applies")] String Service;
};
};
2 changes: 1 addition & 1 deletion DSCResources/MSFT_xFirewall/MSFT_xFirewall.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -663,4 +663,4 @@ function Get-FirewallRuleProperty

#endregion

Export-ModuleMember -Function *-TargetResource
Export-ModuleMember -Function *-TargetResource
2 changes: 1 addition & 1 deletion DSCResources/MSFT_xIPAddress/MSFT_xIPAddress.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,4 @@ function ValidateProperties
}

# FUNCTIONS TO BE EXPORTED
Export-ModuleMember -function Get-TargetResource, Set-TargetResource, Test-TargetResource
Export-ModuleMember -function Get-TargetResource, Set-TargetResource, Test-TargetResource
3 changes: 1 addition & 2 deletions DSCResources/MSFT_xIPAddress/MSFT_xIPAddress.schema.mof
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[ClassVersion("1.0.0"), FriendlyName("xIPAddress")]
[ClassVersion("1.0.0"), FriendlyName("xIPAddress")]
class MSFT_xIPAddress : OMI_BaseResource
{
[Key] string IPAddress;
Expand All @@ -7,4 +7,3 @@ class MSFT_xIPAddress : OMI_BaseResource
[Write] uint32 SubnetMask;
[Write,ValueMap{"IPv4", "IPv6"},Values{"IPv4", "IPv6"}] string AddressFamily;
};

2 changes: 1 addition & 1 deletion Tests/MSFT_xFirewall.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ Describe 'Schema Validation for MSFT_xFirewall' {
It 'should pass Test-xDscResource' {
$result | Should Be $true
}
}
}
9 changes: 6 additions & 3 deletions Tests/MSFT_xIPAddress.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@

Describe 'Schema Validation MSFT_xIPAddress' {
Copy-Item -Path ((get-item .).parent.FullName) -Destination $(Join-Path -Path $env:ProgramFiles -ChildPath 'WindowsPowerShell\Modules\') -Force -Recurse
$result = Test-xDscResource MSFT_xIPAddress

It 'should pass Test-xDscResource' {
$result = Test-xDscResource MSFT_xIPAddress
$result | Should Be $true
}
}

# This is here due to an occasional error in Pester where it believes multiple versions
# of the Module has been loaded.
Get-Module MSFT_xIPAddress -All | Remove-Module -Force -ErrorAction:SilentlyContinue
Import-Module -Name $PSScriptRoot\..\DSCResources\MSFT_xIPAddress -Force -DisableNameChecking

Expand Down Expand Up @@ -47,7 +50,7 @@ InModuleScope MSFT_xIPAddress {
Subnet = -16
}

{ Get-TargetResource @Splat } | Should throw
{ Get-TargetResource @Splat } | Should Throw "Value was either too large or too small for a UInt32."
}
}
}
Expand Down Expand Up @@ -113,4 +116,4 @@ InModuleScope MSFT_xIPAddress {
}
}
}
}
}

0 comments on commit b9b9a93

Please sign in to comment.