Skip to content

Commit

Permalink
#305: Fix schedules, and timer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Badgerati committed Jul 22, 2019
1 parent c7837f9 commit 86a90f2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Private/Helpers.ps1
Expand Up @@ -812,7 +812,7 @@ function New-PodePSDrive
}

# create the temp drive
$drive = (New-PSDrive -Name $Name -PSProvider FileSystem -Root $Path -Scope Global -ErrorAction Stop)
$drive = (New-PSDrive -Name $Name -PSProvider FileSystem -Root $Path -Scope Global)

# store internally, and return the drive's name
if (!$PodeContext.Server.Drives.ContainsKey($drive.Name)) {
Expand Down
10 changes: 0 additions & 10 deletions tests/unit/Middleware.Tests.ps1
Expand Up @@ -72,16 +72,6 @@ Describe 'Middleware' {
$PodeContext.Server.Middleware[0].Route | Should Be '/api'
}

It 'Adds single middleware script to list with route and return' {
$PodeContext = @{ 'Server' = @{ 'Middleware' = @(); }; }

$result = (Middleware -Route '/api' -ScriptBlock { write-host 'middle1' } -Return)

$PodeContext.Server.Middleware.Length | Should Be 0
$result.Logic.ToString() | Should Be ({ Write-Host 'middle1' }).ToString()
$result.Route | Should Be '/api'
}

It 'Adds two middleware scripts to list' {
$PodeContext = @{ 'Server' = @{ 'Middleware' = @(); }; }

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Timers.Tests.ps1
Expand Up @@ -66,7 +66,7 @@ Describe 'Add-PodeTimer' {
$timer.Limit | Should Be 0
$timer.Count | Should Be 0
$timer.Skip | Should Be 1
$timer.Countable | Should Be $true
$timer.Countable | Should Be $false
$timer.NextTick | Should BeOfType System.DateTime
$timer.Script | Should Not Be $null
$timer.Script.ToString() | Should Be ({ Write-Host 'hello' }).ToString()
Expand All @@ -80,7 +80,7 @@ Describe 'Add-PodeTimer' {
$timer | Should Not Be $null
$timer.Name | Should Be 'test'
$timer.Interval | Should Be 3
$timer.Limit | Should Be 3
$timer.Limit | Should Be 2
$timer.Count | Should Be 0
$timer.Skip | Should Be 1
$timer.Countable | Should Be $true
Expand Down

0 comments on commit 86a90f2

Please sign in to comment.