33 lines
920 B
PowerShell
33 lines
920 B
PowerShell
|
. $PSScriptRoot\..\..\Load-PesterModules.ps1
|
|||
|
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|||
|
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.tests\.', '.'
|
|||
|
$functionPath = Join-Path -Path $here -ChildPath $sut
|
|||
|
Write-Host "Overriding SUT: $functionPath"
|
|||
|
Import-Module $functionPath -Force
|
|||
|
$moduleForMock = ""
|
|||
|
|
|||
|
#region Get-HostsFileContent
|
|||
|
|
|||
|
Describe "Get-HostsFileContent" {
|
|||
|
|
|||
|
Context "When a bad path is supplied to Get-HostsFileContent" {
|
|||
|
|
|||
|
It "Writes a Warning" {
|
|||
|
|
|||
|
{
|
|||
|
$tempPath = [System.IO.Path]::GetTempFileName()
|
|||
|
((Get-HostsFileContent $tempPath) 3>&1) -match "Could not read hosts file from"
|
|||
|
} | Should Be $true
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
Context "When default parameters are used" {
|
|||
|
|
|||
|
It "Returns Some Content" {
|
|||
|
|
|||
|
Get-HostsFileContent | Should Not Be $null
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion Get-HostsFileContent
|