BeforeAll { $Repo = Get-RepoPath Import-Module $Repo.Src.Manifest.Item.FullName -Force #$srcFile = Join-Path -Path $Repo.Src.Path -ChildPath 'FileLinter/Test-FileEOF.ps1' #. "$srcFile" #$srcFile = Join-Path -Path $Repo.Src.Path -ChildPath 'FileLinter/Test-FileEOL.ps1' #. "$srcFile" } Describe 'Test-FileEOF' { Context 'Default tests' -Tag 'Default' { It 'Test Function' { { Get-Command -Name 'Test-FileEOF' -Module $Repo.Artifact } | Should -Not -Throw } It 'Test Help' { { Get-Help -Name 'Test-FileEOF' } | Should -Not -Throw } It 'Help Content' { $foo = Get-Help -Name 'Test-FileEOF' $foo.Synopsis.Length | Should -BeGreaterThan 5 $foo.Description.Count | Should -BeGreaterOrEqual 1 $foo.Description[0].Text.Length | Should -BeGreaterThan 5 } } Context 'Coding tests' -Tag 'Unit' { It 'Should throw' { { Test-FileEOF -foo } | Should -Throw } It 'Should not throw' { { Test-FileEOF -Path $Repo.Src.Manifest.Item.FullName } | Should -Not -Throw } It 'Should be true' { Test-FileEOF -Path $Repo.Src.Manifest.Item.FullName | Should -Be $true } } }