Skip to content

Commit

Permalink
Remove demo tests, add space culture test, add Clear-CacheStore function
Browse files Browse the repository at this point in the history
  • Loading branch information
briantist committed Oct 15, 2018
1 parent c3a4f8b commit f3e227b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
16 changes: 16 additions & 0 deletions NameIT.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,22 @@ function Get-CacheStore {
}
}

function Clear-CacheStore {
[CmdletBinding()]
param(
[Parameter()]
[String]
$Key
)

$local:cache = Get-CacheStore

if ($key) {
$null = $local:cache.Remove($key)
} else {
$local:cache.Clear()
}
}
function Get-CacheableContent {
[CmdletBinding(DefaultParameterSetName = 'Path')]
param(
Expand Down
23 changes: 6 additions & 17 deletions __tests__/nameit.tests.ps1
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
Import-Module "$PSScriptRoot/../NameIT.psd1"
Import-Module "$PSScriptRoot/../NameIT.psd1" -Force

Describe "NameIT Tests" {

Clear-CacheStore

It "Should generate five entries" {
$actual = Invoke-Generate -Template "[person]" -Count 5
$actual.count | Should Be 5
}

# It "Should pass on 5.1 and 6" {
# (Get-WmiObject win32_bios) | Should Not Be Null
# }

It "Should pass 5.1 and 6" {
(Get-CimInstance win32_bios) | Should Not Be Null
It "Should return a culture-specific space character" {
$actual = Invoke-Generate -Template '[space 1 ja-JP]'
$actual -as [char] -as [int] | Should Be 12288
}

# It "Should fail on Linux" {
# "" | Set-Content "$PSScriptRoot\Test.txt"
# (Test-Path "$PSScriptRoot\test.txt") | Should Be $true
# }

# It "Should pass on Linux - correct case" {
# "" | Set-Content "$PSScriptRoot\test.txt"
# (Test-Path "$PSScriptRoot\test.txt") | Should Be $true
# }
}

0 comments on commit f3e227b

Please sign in to comment.