Skip to content

Commit

Permalink
🔧 Clarify AboutPSProviders->FileSystemProvider Koan. (#189)
Browse files Browse the repository at this point in the history
* Replaced dynamic test with static text

* Added beforeAll block
  • Loading branch information
Brandon Lundt authored and vexx32 committed Jun 3, 2019
1 parent ce875f3 commit 1edc1b9
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions PSKoans/Koans/Cmdlets 1/AboutPSProviders.Koans.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,16 @@ Describe 'Environment Provider' {
}

Describe 'FileSystem Provider' {
$Path = 'TestDrive:' | Join-Path -ChildPath 'File001.tmp'
if (-not (Test-Path $Path)) {
New-Item -Path $Path > $null

-join (1..10000 | ForEach-Object {
Get-Random -Minimum 32 -Maximum 96 |
ForEach-Object {[char]$_ -as [string]}
if ((Get-Random) -match '[25]0$') {
"`n"
}
}) | Set-Content -Path $Path
BeforeAll {
$Path = 'TestDrive:' | Join-Path -ChildPath 'File001.tmp'

$FileContent = @'
PSKOANS!
The Env: drive contains system environment data. Its contents can vary wildly from OS to OS,
especially between Windows, Mac, and Linux, for example.
'@
Set-Content -Path $Path -Value $FileContent
}

It 'allows access to various files and their properties' {
$File = Get-Item -Path $Path

Expand Down

0 comments on commit 1edc1b9

Please sign in to comment.